leeyuiwah
leeyuiwah

Reputation: 7162

Same property defined in multiple active profiles in maven - which one shall win?

What exactly would happen when multiple profiles are activated and they have conflicting definitions of a properties? For example, if there are two profiles both define the properties ${platform-path} but define it as two different values, what would be the final effective value used?

I tried using the help:effective-pom and it seems it is the profile defined later in the settings.xml file who has the last word, but I could not seem to see this behavior documented in either the maven site nor the sonaType book.

Upvotes: 4

Views: 1247

Answers (1)

dbraga
dbraga

Reputation: 41

I guess it depends on the implementation of the xml parser. A quick test showed me that the last definition of the variable on the pom file is the one that is considered the correct one.

Upvotes: 3

Related Questions