Skip to content

Commit 1949c41

Browse files
committed
GH-528 - Add section on @Modulithic to reference documentation.
1 parent 1f4df2d commit 1949c41

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

src/docs/antora/modules/ROOT/pages/fundamentals.adoc

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,3 +330,67 @@ This class needs to be registered in `META-INF/spring.factories` as follows:
330330
org.springframework.modulith.core.ApplicationModuleDetectionStrategy=\
331331
example.CustomApplicationModuleDetectionStrategy
332332
----
333+
334+
[[customizing-modules-arrangement]]
335+
== Customizing the Application Modules Arrangement
336+
337+
Spring Moduliths allows to configure some core aspects around the application module arrangement you create via the `@Modulithic` annotation to be used on the main Spring Boot application class.
338+
339+
[tabs]
340+
======
341+
Java::
342+
+
343+
[source, java, role="primary"]
344+
----
345+
package example;
346+
347+
import org.springframework.boot.SpringApplication;
348+
import org.springframework.boot.autoconfigure.SpringBootApplication;
349+
import org.springframework.modulith.Modulithic;
350+
351+
@Modulithic
352+
@SpringBootApplication
353+
class MyApplication {
354+
355+
public static void main(String... args) {
356+
SpringApplication.run(DemoApplication.class, args);
357+
}
358+
}
359+
----
360+
Kotlin::
361+
+
362+
[source, kotlin, role="secondary"]
363+
----
364+
package example
365+
366+
import org.springframework.boot.autoconfigure.SpringBootApplication
367+
import org.springframework.boot.runApplication
368+
import org.springframework.modulith.Modulithic
369+
370+
@Modulithic
371+
@SpringBootApplication
372+
class DemoApplication
373+
374+
fun main(args: Array<String>) {
375+
runApplication<DemoApplication>(*args)
376+
}
377+
----
378+
======
379+
380+
The annotation exposes the following attributes to customize:
381+
382+
[cols="1,3", options="header, unbreakable"]
383+
|===
384+
|Annotation attribute
385+
|Description
386+
387+
|`systemName`
388+
|The human readable name of the application to be used in generated xref:documentation.adoc#documentation[documentation].
389+
390+
|`sharedModules`
391+
|Declares the application modules with the given names as shared modules, which means that they will be always included in xref:testing.adoc#testing[application module integration tests].
392+
393+
|`additionalPackages`
394+
|Instructs Spring Modulith to treat the configured packages as additional root application packages. In other words, application module detection will be triggered for those as well.
395+
396+
|===

0 commit comments

Comments
 (0)