desruisseaux commented on PR #11639:
URL: https://github.com/apache/maven/pull/11639#issuecomment-3864408341

   I forgot about `preserveModelVersion`. Indeed, it can be used for deciding 
whether to strip `<build>`. I will apply this change.
   
   Regarding `<dependencie>`, this is another issue. The removal of 
dependencies is not for compatibility with the 4.0.0 model. It is because the 
current strategy of https://github.com/apache/maven-jar-plugin/pull/508 uses 
the consumer POM of the project as the parent of the POM of each module. If we 
do not remove the dependencies, then every modules would inherit all project's 
dependencies, including the dependencies that a module does not use.
   
   Said otherwise, in a multi-module project, `<dependencies>` actually behave 
more like `<dependencyManagement>`. Not removing dependencies would be a little 
bit like inheriting the full content of `<dependencyManagement>` as 
dependencies, regardless if used or not.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to