maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Kolotyluk <eric.koloty...@gmail.com>
Subject Re: activeProfiles
Date Sun, 24 Mar 2013 16:51:49 GMT
Sweet!

I was wondering if there was some way to activate a profile 
conditionally. Can the property be defined in a pom.xml, or does it have 
to be defined elsewhere.?

Cheers, Eric

On 2013-03-24 7:46 AM, Robert Scholte wrote:
> For our mojo-projects we often have a profile for integration-tests, 
> which is active by default with the following trick:
>       <activation>
>         <property>
>           <name>skipTests</name>
>           <value>!true</value>
>         </property>
>       </activation>
>
> This means that if and only if there's a property skipTests and its 
> value is true, the profile is deactivated.
>
> Robert
>
> Op Sun, 24 Mar 2013 15:41:57 +0100 schreef Eric Kolotyluk 
> <eric.kolotyluk@gmail.com>:
>
>> I was trying to avoid having two setting.xml files. I was also 
>> thinking of
>> having two login accounts each with their own settings.xml as role based
>> login makes more sense. Thanks for confirming my thinking.
>>
>> Seriously too bad that <activeProfiles> cannot be in a pom.xml file.
>>
>> Cheers, Eric
>> On Mar 23, 2013 7:15 AM, "Wayne Fay" <waynefay@gmail.com> wrote:
>>
>>> > I am trying to set up my projects so that the POM knows which 
>>> profile to
>>> > activate, but it seems you cannot put <activeProfiles> in a POM, 
>>> only in
>>> a
>>> > settings.xml file. Is there some reason for this?
>>> >
>>> > Is there some other Maven way to do what I want to do? How do other
>>> people
>>> > separate work development from personal development?
>>>
>>> One technique I've employed uses two settings.xml files. First you 
>>> should
>>> know about the -s option when calling mvn, look it up. Copy mvn.bat to
>>> mvnp.bat and mvnw.bat (or .sh). In mvnp.bat, specify -s
>>> settings-personal.xml and in mvnw.bat, specify -s settings-work.xml.
>>>
>>> Then call mvnw or mvnp instead of mvn. You can also adjust mvn.bat 
>>> directly
>>> and use that for personal (or work, whichever is most common).
>>>
>>> Or just set up another user account and log in/out depending on what 
>>> you
>>> are working on, each with its own settings.xml. This is easier on
>>> Linux/Unix.
>>>
>>> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


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


Mime
View raw message