Spring Modulith
© 2022-2025 原始作者。
| 您可以為自己使用和分發此文件的副本,前提是您不對這些副本收取任何費用,並且每份副本(無論是印刷版還是電子版)都包含此版權宣告。 |
概述
Spring Modulith 是一個固執己見的工具包,用於使用 Spring Boot 構建領域驅動的模組化應用程式。就像 Spring Boot 對應用程式的技術安排有自己的看法一樣,Spring Modulith 對如何從功能上構建應用程式並允許其各個邏輯部分相互互動有自己的實現。因此,Spring Modulith 使開發人員能夠構建更易於更新的應用程式,從而可以隨著時間的推移適應不斷變化的業務需求。
專案元資料
-
釋出儲存庫:Maven Central
-
里程碑儲存庫: repo.spring.io/milestone
-
快照儲存庫: repo.spring.io/snapshot
Spring Boot 相容性
完整的 Spring Boot 相容性矩陣請在此處查詢。
使用 Spring Modulith
Spring Modulith 由一組庫組成,可以單獨使用,具體取決於您希望使用它的哪些功能。為了方便宣告各個模組,我們建議您在 Maven POM 中宣告以下 BOM
使用 Spring Modulith BOM
-
Maven
-
Gradle
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-bom</artifactId>
<version>2.0.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
dependencyManagement {
imports {
mavenBom 'org.springframework.modulith:spring-modulith-bom:2.0.0'
}
}
描述 Spring Modulith 功能的各個部分將引用實現該功能所需的各個工件。有關所有可用模組的概述,請參閱Spring Modulith 模組。
示例
如果您想試用專案的功能並親眼看看它們的實際效果,請在此處檢視示例:https://github.com/spring-projects/spring-modulith/tree/2.0.0/spring-modulith-examples