Skip to content

Conversation

@desruisseaux
Copy link
Contributor

Maven 4 automatically generates a consumer POM after a successful build. This consumer POM already excludes some elements from the original POM such as the list of sub-projects. However, when building a modular project (in Java sense), there are two more elements that need to be excluded:

  • <build> because it contains (in the modular case) the <sources> element which is not compatible with the Maven 4.0.0 model. This pull request removes the full <build> element instead of only the <sources> child element because the build configuration is invalid without the sources, and I think that information about how the project was built is not really necessary for consumers anyway.
  • <dependencies> because the effective dependencies will be dispatched in the POM files generated by maven-jar-plugin for each Java module from the content of module-info.class.

@desruisseaux desruisseaux requested a review from gnodet January 11, 2026 18:21
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