maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Wheeler <rwhee...@artifact-software.com>
Subject Re: Help referencing profile properties/attributes...
Date Thu, 20 Jan 2011 15:33:50 GMT
We have had long discussions about why profiles are not the right way to 
deal with environment/deployment issues.

Ron

On 20/01/2011 3:05 AM, Anders Hammar wrote:
> Not that I know of, no.
>
> In your example, why don't you just specify the value ('staging') in the
> confgiuration of the surefire plugin?
>
> /Anders
>
> On Thu, Jan 20, 2011 at 07:52, Jeff<predatorvi@gmail.com>  wrote:
>
>> 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
>> predatorvi@gmail.com
>> See my LinkedIn profile at:
>> http://www.linkedin.com/in/rjeffreyvincent
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message