spring-projects / spring-projects/spring-modulith

Feature: Flexible Filtering for `ApplicationModules`

Open
#1,515 2 comments 0 reactions 0 assignees View on GitHub

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 DescribedPredicate sharing a name with the class blocks the import.
  • Lack of Composition: Cannot apply multiple ImportOption filters (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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.