today I observed that the maven proprties defined in settings.xml
overwrite the one in pom.xml
.
Because it is only a observation, I am not sure if this is totally correct. So I am looked for the reference or some article but I find no concrete statement about the behaviour of overwriting properties defined with the same name in settings.xml
and pom.xml
.
Maybe someone can provide a link to the reference part (that I may overlooked) or the a reliable article/blog?
Based on the documentation in my opinion it is clear which one has precedence over the other (excerpt of the docs):
If a profile is active from settings, its values will override any equivalently ID'd profiles in a POM or profiles.xml file.
The profiles.xml does not exist anymore in Maven 3 only in Maven 2.2.1 it is supported but shouldn't be used.
I think properties with equal names are overridden in next sequence (from highest to lowest context):
http://maven.apache.org/guides/introduction/introduction-to-profiles.html
Hence, pom.xml
properties (per project) are overridden by settings.xml
(per user) properties with equal names.
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