Spring Modulith
© 2022-2023 原作者。
© 2022-2023 The original authors.
您可以出于自己的使用和分发给其他人的目的对本文件进行复制,前提是您不会对复制收取任何费用,并且无论以印刷形式还是电子形式分发,每个副本都包含此版权声明。 |
Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically. |
Overview
Spring Modulith是一个基于观点的工具包,用于利用Spring Boot构建领域驱动、模块化应用程序。Spring Modulith对应用程序如何从技术角度进行排列抱有观点,Spring Boot对此抱有观点,它还执行一个观点,即如何用功能方式构建应用程序及其各个逻辑部分如何相互作用。因此,Spring Modulith使开发人员能够构建应用程序,且这些应用程序更容易更新,以便随着时间的推移能适应不断变化的业务需求。
Spring Modulith is an opinionated toolkit to build domain-driven, modular applications with Spring Boot. In the same way that Spring Boot has an opinion on the technical arrangement of an application, Spring Modulith implements an opinion on how to structure an app functionally and allows its individual, logical parts to interact with each other. As a result, Spring Modulith enables developers to build applications that are easier to update so they can accommodate changing business requirements over time.
Project Metadata
-
Version control [role="bare"]https://github.com/spring-projects/spring-modulith
-
Bug tracker: [role="bare"]https://github.com/spring-projects/spring-modulith
-
Release repository: Maven central
-
Milestone repository: [role="bare"]https://repo.spring.io/milestone
-
Snapshot repository: [role="bare"]https://repo.spring.io/snapshot
-
Javadoc: [role="bare"]https://docs.spring.io/spring-modulith/docs/{projectVersion}/api
Using Spring Modulith
Spring Modulith由一系列库组成,这些库单独或根据您将使用哪些功能进行使用。为了便于宣告各个模块,我们建议您在Maven POM中宣告以下BOM:
Spring Modulith consists of a set of libraries that can be used individually and depending on which features of it you would like to use. To ease the declaration of the individual modules, we recommend to declare the following BOM in your Maven POM:
-
Maven
-
Gradle
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-bom</artifactId>
<version>{projectVersion}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
dependencyManagement {
imports {
mavenBom 'org.springframework.modulith:spring-modulith-bom:{projectVersion}'
}
}
描述 Spring Modulith 特性的各个部分将引用使用该特性所需的各个构件。有关所有可用模块的概述,请查看 Spring Modulith modules。
The individual sections describing Spring Modulith features will refer to the individual artifacts that are needed to make use of the feature. For an overview about all modules available, have a look at Spring Modulith modules.