I am trying to determine how maven processes profiles. I have defined a
property in 2 profiles like this:
<profiles>
  <profile>
    <id>test</id>
    <activation>
      <property>
        <name>env</name>
        <value>test</value>
      </property>
    </activation>
 
    <properties>
      <appserver.home>/path/to/test/appserver</appserver.home>
    </properties>
  </profile>
  <profile>
    <id>dev</id>
    <activation>
 <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
      <appserver.home>/path/to/dev/appserver</appserver.home>
    </properties>
  </profile>
</profiles>
 
When I echo the output and both profiles are active, it is always using
the test profile value. It doesn't seem to matter what the -P order is
nor does it matter what the order in the pom is. 
 
I'm trying to figure out what the deterministic behavior is so I can
make sure I structure my profiles correctly. I will have overlapping
profiles that define "platform" - dev/test/release and "instance" - my
desktop/my laptop etc. I will thus always need multiple profiles active
to define my platform instance (dev - laptop or test-nh for example).
 

Reply via email to