Maven profiles documentation does not mention this, and it is probably a sign of bad build process design, but are there rules for resolving conflicting properties if multiple profiles are active and they all define the same property?
Im quite sure that local declaration (in the pom.xml
) would override the declaration in the settings.xml
, not so sure for colocal profiles
-Pprofile1,profile2
)?Thank you
There is no resolving conflicts happening - only overriding. Afaik the order is settings, pom, and then command line. For multiple profiles in a pom and settings file the order in the file matters as well and beyond that things are different depending on Maven version.
I would strongly suggest to reduce your usage of profiles so that you do NOT have to worry about these complexities and certainly get the help plugin installed.
Also you can see the effective pom within Eclipse in the M2Eclipse plugin in the POM editor. That should help you in the mean time.
And answer to your questions:
Yes
Yes
Yes
All orders matter and can result in, lets just say "surprising" results sometimes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With