Skip to content

Conversation

@yevheniisemenov
Copy link

@yevheniisemenov yevheniisemenov commented Nov 11, 2025

Introduces a generic StrategyLookup utility and makes DocumentationSource configurable via the spring.modulith.documentation-source property, following the same pattern as ApplicationModuleDetectionStrategy.

Key changes:

  • Create generic StrategyLookup utility in spring-modulith-core for reusable configuration-based strategy lookups
  • Refactor ApplicationModuleDetectionStrategyLookup to use the generic StrategyLookup utility, reducing code duplication
  • Add DocumentationSourceLookup with support for predefined strategies and custom implementations via property configuration
  • Add NoOpDocumentationSource as fallback implementation
  • Update Asciidoctor to use DocumentationSourceLookup instead of hardcoded static field
  • Make DocumentationSource interface public (was package-private) and add getDocumentation(JavaPackage) method for package-level docs
  • Add spring-configuration-metadata.json for IDE autocomplete support
  • Add comprehensive test coverage with DocumentationSourceLookupTests

Introduces a generic StrategyLookup utility and makes DocumentationSource
configurable via the spring.modulith.documentation-source property,
following the same pattern as ApplicationModuleDetectionStrategy.

Key changes:
- Create generic StrategyLookup<T> utility in spring-modulith-core for
  reusable configuration-based strategy lookups
- Refactor ApplicationModuleDetectionStrategyLookup to use the generic
  StrategyLookup utility, reducing code duplication
- Add DocumentationSourceLookup with support for predefined strategies
  and custom implementations via property configuration
- Add NoOpDocumentationSource as fallback implementation
- Update Asciidoctor to use DocumentationSourceLookup instead of
  hardcoded static field
- Make DocumentationSource interface public (was package-private) and
  add getDocumentation(JavaPackage) method for package-level docs
- Add spring-configuration-metadata.json for IDE autocomplete support
- Add comprehensive test coverage with DocumentationSourceLookupTests

The implementation supports:
- Predefined strategy: 'spring-modulith' (uses SpringModulithDocumentationSource)
- Custom implementations via fully qualified class name
- SpringFactoriesLoader fallback with deprecation warning (for compatibility)
- IDE autocomplete via configuration metadata

Signed-off-by: Yevhenii Semenov <zhe.semenov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant