spring-projects / spring-projects/spring-modulith
Feature: Flexible Filtering for `ApplicationModules`
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
Problem
ApplicationModules.of(…) factory methods are restrictive. Specifically:
- Naming Collisions: A
DescribedPredicatesharing a name with the class blocks the import. - Lack of Composition: Cannot apply multiple
ImportOptionfilters (e.g., excluding tests AND fixtures) while using predicates.
Proposed Solution
Introduce a Builder or expanded Varargs support to match ArchUnit’s ClassFileImporter flexibility:
// Option A: Builder Pattern
ApplicationModules modules = ApplicationModules.builder(MyApplication.class)
.withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS)
.withExclusion(DescribedPredicate.resideInAPackage("..internal.."))
.build();
// Option B: Importer Injection
ClassFileImporter importer = new ClassFileImporter()
.withImportOption(new DontIncludeTests());
ApplicationModules modules = ApplicationModules.of(MyApplication.class, importer);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the ApplicationModules.of(…) factory methods and the ClassFileImporter entry point described in the issue. Compare the builder and importer-injection options, then define an API that supports multiple ImportOption filters and exclusions without naming collisions. Done means callers can compose those filters while creating ApplicationModules.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100