Skip to content

Commit 7547bc2

Browse files
committed
GH-652 - Polishing.
1 parent ed1cb3f commit 7547bc2

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

spring-modulith-core/src/main/java/org/springframework/modulith/core/ApplicationModuleDetectionStrategyLookup.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,15 @@ class ApplicationModuleDetectionStrategyLookup {
7070
* Returns the {@link ApplicationModuleDetectionStrategy} to be used to detect {@link ApplicationModule}s. Will use
7171
* the following algorithm:
7272
* <ol>
73-
* <li>Use the prepared strategies if
73+
* <li>Use the prepared strategies if either {@code direct-sub-packages} or {@code explicitly-annotated} is configured
74+
* for the {@code spring.modulith.detection-strategy} configuration property.</li>
75+
* <li>Interpret the configured value as class if it doesn't match the predefined values just described.</li>
76+
* <li>Use the {@link ApplicationModuleDetectionStrategy} declared in {@code META-INF/spring.properties}
77+
* (deprecated)</li>
78+
* <li>A final fallback on the {@code direct-sub-packages}.</li>
79+
* </ol>
7480
*
75-
* @return
81+
* @return will never be {@literal null}.
7682
*/
7783
static ApplicationModuleDetectionStrategy getStrategy() {
7884

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
|`true`
1414
|Whether to configure defaults for the async processing termination, namely to wait for task completion for 2 seconds. See `TaskExecutionProperties` for details.
1515

16+
|`spring.modulith.detection-strategy`
17+
|none
18+
|The strategy to be applied to detect application modules.
19+
Can either be the class name of a custom implementation of `ApplicationModuleDetectionStrategy` or `direct-subpackages` (which is also the final fallback if nothing is configured) or `explicitly-annotated` to only select packages explicitly annotated with `@ApplicationModule` or jMolecules' `@Module`. See xref:fundamentals.adoc#customizing-modules[Customize Application Module Detection] for details.
20+
1621
|`spring.modulith.events.externalization.enabled`
1722
|`true`
1823
|Whether to enable event externalization.

0 commit comments

Comments
 (0)