From 79f40e9f2a55019323eeea47dd1007d1c3e834a1 Mon Sep 17 00:00:00 2001 From: Cora Iberkleid Date: Wed, 11 Dec 2024 15:27:34 -0500 Subject: [PATCH] GH-943 - Explain when to add Spring Modulith's Core artifact as compile-time dependency. --- .../modules/ROOT/pages/fundamentals.adoc | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/docs/antora/modules/ROOT/pages/fundamentals.adoc b/src/docs/antora/modules/ROOT/pages/fundamentals.adoc index c0741cbd..acb85de4 100644 --- a/src/docs/antora/modules/ROOT/pages/fundamentals.adoc +++ b/src/docs/antora/modules/ROOT/pages/fundamentals.adoc @@ -516,6 +516,30 @@ This class can now be registered as `spring.modulith.detection-strategy` as foll spring.modulith.detection-strategy=example.CustomApplicationModuleDetectionStrategy ---- +If you are implementing the `ApplicationModuleDetectionStrategy` interface to customize the verification and documentation of modules, include the customization and its registration in your application's test sources. However, if the customization is intended for runtime components that require access to the module structure—potentially in relation to xref:runtime.adoc#spring-modulith-runtime-support[Spring Modulith runtime support] or xref:production-ready.adoc#production-ready-features[production-ready features] (e.g., actuator and observability support)—you must explicitly declare the following as a compile-time dependency: + +[tabs] +====== +Maven:: ++ +[source, xml, role="primary"] +---- + + org.springframework.modulith + spring-modulith-core + +---- +Gradle:: ++ +[source, groovy, role="secondary"] +---- +dependencies { + implementation 'org.springframework.modulith:spring-modulith-core' +} +---- +====== + + [[contributing-application-modules]] === Contributing Application Modules From Other Packages