Spring Modulith

© 2022-2023 原始作者。

您可以為個人使用或分發給他人複製本文件,前提是您不收取任何費用,且每份副本都包含本版權宣告,無論是印刷版還是電子版。

概覽

Spring Modulith 是一個有主見的工具集,用於使用 Spring Boot 構建領域驅動的模組化應用。就像 Spring Boot 對應用的技術結構有主見一樣,Spring Modulith 對如何按功能組織應用以及如何讓應用的各個邏輯部分相互協作提出了自己的主見。因此,Spring Modulith 使開發人員能夠構建更容易更新的應用,從而能夠適應不斷變化的業務需求。

專案元資料

Spring Boot 相容性

在此處查詢完整的 Spring Boot 相容性矩陣 here

使用 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>1.3.5</version>
      <scope>import</scope>
      <type>pom</type>
    </dependency>
  </dependencies>
</dependencyManagement>
dependencyManagement {
	imports {
		mavenBom 'org.springframework.modulith:spring-modulith-bom:1.3.5'
	}
}

描述 Spring Modulith 特性的各個章節將引用使用該特性所需的獨立 Artifact。有關所有可用模組的概覽,請參閱 Spring Modulith 模組

示例

如果您想體驗該專案的特性並檢視其實際執行情況,請在此處檢視示例 here