From 4823bbad169dfd667262a9d1e250297a664c2ebd Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Thu, 6 Jun 2024 16:23:58 +0200 Subject: [PATCH] GH-656 - Polishing. --- .../core/ApplicationModuleDetectionStrategyLookup.java | 10 ++++++++-- src/docs/antora/modules/ROOT/pages/appendix.adoc | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/spring-modulith-core/src/main/java/org/springframework/modulith/core/ApplicationModuleDetectionStrategyLookup.java b/spring-modulith-core/src/main/java/org/springframework/modulith/core/ApplicationModuleDetectionStrategyLookup.java index 5c231ab5..9208fef9 100644 --- a/spring-modulith-core/src/main/java/org/springframework/modulith/core/ApplicationModuleDetectionStrategyLookup.java +++ b/spring-modulith-core/src/main/java/org/springframework/modulith/core/ApplicationModuleDetectionStrategyLookup.java @@ -70,9 +70,15 @@ class ApplicationModuleDetectionStrategyLookup { * Returns the {@link ApplicationModuleDetectionStrategy} to be used to detect {@link ApplicationModule}s. Will use * the following algorithm: *
    - *
  1. Use the prepared strategies if + *
  2. Use the prepared strategies if either {@code direct-sub-packages} or {@code explicitly-annotated} is configured + * for the {@code spring.modulith.detection-strategy} configuration property.
  3. + *
  4. Interpret the configured value as class if it doesn't match the predefined values just described.
  5. + *
  6. Use the {@link ApplicationModuleDetectionStrategy} declared in {@code META-INF/spring.properties} + * (deprecated)
  7. + *
  8. A final fallback on the {@code direct-sub-packages}.
  9. + *
* - * @return + * @return will never be {@literal null}. */ static ApplicationModuleDetectionStrategy getStrategy() { diff --git a/src/docs/antora/modules/ROOT/pages/appendix.adoc b/src/docs/antora/modules/ROOT/pages/appendix.adoc index e3f02520..75dc71df 100644 --- a/src/docs/antora/modules/ROOT/pages/appendix.adoc +++ b/src/docs/antora/modules/ROOT/pages/appendix.adoc @@ -13,6 +13,11 @@ |`true` |Whether to configure defaults for the async processing termination, namely to wait for task completion for 2 seconds. See `TaskExecutionProperties` for details. +|`spring.modulith.detection-strategy` +|none +|The strategy to be applied to detect application modules. +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. + |`spring.modulith.events.externalization.enabled` |`true` |Whether to enable event externalization.