- Notifications
You must be signed in to change notification settings - Fork177
Modular applications with Spring Boot
License
spring-projects/spring-modulith
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Spring Modulith allows developers to build well-structured Spring Boot applications and guides developers in finding and working withapplication modules driven by the domain.It supports theverification of such modular arrangements,integration testing individual modules,observing the application’s behavior on the module level and creatingdocumentation snippets based on the arrangement created.
Create a Spring Boot application onhttps://start.spring.io
Add Spring Modulith to your application by adding this to your
pom.xml:<!-- Include the BOM for simplified version management--><dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.modulith</groupId> <artifactId>spring-modulith-bom</artifactId> <version>1.3.1</version> <scope>import</scope> <type>pom</type> </dependency> </dependencies></dependencyManagement><dependencies><!-- The test dependency to pull in verification APIs--> <dependency> <groupId>org.springframework.modulith</groupId> <artifactId>spring-modulith-starter-test</artifactId> <scope>test</scope> </dependency></dependencies>
Create a Java package arrangement that puts business modules asdirect sub-packages of the application’s main package.
□ Example└─ □ src/main/java ├─ □ example <1> | └─ Application.java ├─ □ example.inventory <2> | └─ … └─ □ example.order <2> └─ …The application root package
Application module packages
Createan
ApplicationModulesmodel, runverifications andcreate documentation snippets.classApplicationTests {@TestvoidwriteDocumentationSnippets() {varmodules =ApplicationModules.of(Application.class).verify(); (1)newDocumenter(modules) (2) .writeModulesAsPlantUml() .writeIndividualModulesAsPlantUml(); }}
Creates application module model andverifies its structure.
RendersAsciidoctor snippets (component diagrams, application module canvas) to
target/modulith-docs.
Runintegration tests for individual application modules.
□ Example└─ □ src/test/java └─ □ example.order └─ OrderModuleIntegrationTests.java@ApplicationModuleTestsclassOrderModuleIntegrationTests {@TestvoidsomeTestMethod() { … }}
Find the reference documentationhere.
Pull requests are welcome. Note, that we expect everyone to follow thecode of conduct.
Clone the repository
git clone git@github.com:spring-projects/spring-modulith.gitcd spring-modulithSpring Modulith is Open Source software released under theApache 2.0 license.
About
Modular applications with Spring Boot
Topics
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.