You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kevin Frankic <kf...@studiocom.com> on 2007/08/30 21:43:43 UTC

profiles.xml - profile activation

Hello,

 

I have a profiles.xml that has 2 profiles within it.  The default
profile is set to be active by default, which works fine.  I then would
like to activate more profiles based on an environment variable
'DEV_USER'.  Within my pom.xml, I can access 'DEV_USER' successfully by
doing the following "${env.DEV_USER}".  Unfortuately, when I try to
access that same variable within my 'profiles.xml', it's not recognized,
preventing that profile from activating.  I have tried naming that
property DEV_USER, ${DEV_USER}, env.DEV_USER, and ${env.DEV_USER}, none
of which were a success.  However, if I run "mvn help:active-profiles
-DDEV_USER" from a commandline, both profiles are activated, which is
what I want.

 

Is it not possible to access system variables from within a
profiles.xml?  

 

Thanks for any clarification,

Kevin

 

 

Profiles.xml

<profilesXml>

<profiles>

 

  <profile>

    <id>default</id>

      <activation>

            <activeByDefault>true</activeByDefault>

      </activation>    

    <properties>

    </properties>

  </profile>

 

  <profile>

    <id>bert</id>

      <activation>

            <activeByDefault>false</activeByDefault>

            <property>

                  <name>DEV_USER</name>

            </property>

      </activation>    

    <properties>

    </properties>

  </profile>

  

</profiles>

</profilesXml>