-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Jonathan Haber opened MNG-7709 and commented
While upgrading to Maven 3.9.0, we noticed a change in the way some of our pom configuration is parsed. This seems to be a very rare edge case that we can work around, but I wanted to flag it in case the root cause turns out to have more widespread impact. I put together a small repo that demonstrates the issue:
https://github.com/jhaber/maven-configuration-reproducer
Summary of reproducer:
- The parent module configures the shade plugin with an outputFile parameter: link
- The child module inherits from parent and resets the shade plugin configuration (using <configuration combine.self="override"/>): link
- However, child module also configures shade plugin inside a profile (adding an unrelated finalName parameter): link
- The nested-child module inherits from child module. It doesn't contain any configuration, but it activates the profile: link
It is expected that child and nested-child do not inherit the outputFile parameter, because the shade configuration is removed in child pom.xml. This works in Maven 3.8.7, but in Maven 3.9.0 the nested-child module does inherit the outputFile parameter. I assume this has something to do with the profile getting activated and causing the configuration to not get merged properly, but I'm not sure.
I also built a custom version of Maven 3.9.0 which uses plexus-utils 3.3.1, and the behavior is back to normal. So I think the behavior change is in plexus-utils (although it could be that Maven is "mis-using" plexus-utils, and the plexus-utils change is technically correct). I tested with a few different plexus-utils versions and it seems like the behavior change was introduced in plexus-utils 3.4.0 (I also tested with plexus-utils 3.5.0 and this issue is not fixed).
Affects: 3.9.0, 4.0.0-alpha-4
Issue Links:
-
MNG-7710 Upgrade plexus-utils to 3.5.1
("is fixed by") -
MNG-7683 Plugin configuration is merged incorrectly
-
MNG-7697 Cannot parse POM that contains an emoji in a comment
Remote Links:
Backported to: 4.0.0-alpha-5, 3.9.1