Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.9.0, 4.0.0-alpha-4
-
None
Description
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).