Skip to content

Consumer POM of multi-module project should exclude <build> and <dependencies> elements#11764

Merged
desruisseaux merged 1 commit intoapache:maven-4.0.xfrom
Geomatys:backport/consumer-pom-of-modular-project
Mar 27, 2026
Merged

Consumer POM of multi-module project should exclude <build> and <dependencies> elements#11764
desruisseaux merged 1 commit intoapache:maven-4.0.xfrom
Geomatys:backport/consumer-pom-of-modular-project

Conversation

@desruisseaux
Copy link
Copy Markdown
Contributor

This is a backport of #11639. It modifies the code that already exists in Maven core for deriving consumer POM. The modification consists in excluding <build> and <dependencies> when the project is a multi-module project. The rational is explained in #11639. Note that for classical Maven projects, nothing change.

…ndencies> elements (apache#11639)

* Move some of the codes needed by `ProjectSourcesHelper` in an utility class that we can reuse in other packages.
* Consumer POM of multi-module project should exclude <build> and <dependencies> elements.
* Add a test that verifies that `<build>` is preserved when `preserveModelVersion=true`.

Co-authored-by: Gerd Aschemann <gerd@aschemann.net>
@desruisseaux
Copy link
Copy Markdown
Contributor Author

This is a backport of a change which was accepted on master three weeks ago. I tested again today after a rebase and saw no issue. I think that we can merge. This pull request is needed for allowing progress on apache/maven-jar-plugin#508.

@desruisseaux desruisseaux self-assigned this Mar 27, 2026
@desruisseaux desruisseaux added this to the 4.0.0-rc-6 milestone Mar 27, 2026
@desruisseaux desruisseaux merged commit 73dc373 into apache:maven-4.0.x Mar 27, 2026
22 checks passed
@desruisseaux desruisseaux deleted the backport/consumer-pom-of-modular-project branch March 27, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant