I'm new to Maven and am building a POM with profiles.  I want to be able to
set a system property that contains the value of the current profile(s).

Currently I have multiple profiles that each relate to different web app
servers (dev, test, staging, etc.) in our dev/test environment.  I want the
profile (via the surefire plugin) to set a system property called "config"
that can be read during the "test" goal to change which web app server to
use (via property file).

Currently the value of the "config" system property is equivalent to the
value of the profile id.  Is there a syntax in the POM for referencing the
id of the profile that is in the parent chain of the property being set?

For example, in the profile below, can I reference the profile id in order
to retrieve the value "staging"?  I've tried ${profile.id}, ${id}, but they
don't work.

<profiles>
    <profile>
      *<id>staging</id>
*    ...
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.7.1</version>
            <configuration>
              <skip>false</skip>
              <systemPropertyVariables>
                *<config>${profile.id}</config>
*        ...

   </profile>
</profiles>

Thanks!!

-- 
Jeff Vincent
predato...@gmail.com
See my LinkedIn profile at:
http://www.linkedin.com/in/rjeffreyvincent

Reply via email to