Skip to content

Legacy resources in modular build should fail #11701

@elharo

Description

@elharo

Affected version

HEAD 4.1.x

Bug description

See #11612 and #11505 and #11632 on master branch.
Maven 4.x introduces a unified <sources> element that supports modular project layouts (src/<module>/<scope>/<lang>). However, resource handling did not follow the modular layout - resources were always loaded from the legacy <resources> element which defaults to src/main/resources. This change implements automatic module-aware resource injection.

  • For modular projects without resource configuration in <sources>, automatically inject resource roots following the modular layout: src/<module>/main/resources and src/<module>/test/resources.
  • Resources configured via <sources> take priority over legacy <resources>.
  • Issue warnings (as ModelProblem) when explicit legacy resources are ignored.

The first two are fine. The last isn't. Resources the user clearly meant to include are dropped from the build. This should be a full build failure that requires the user to fix their project one way or another, not a simple warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:criticalCrashes, loss of data, severe memory leak

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions