You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stephen Connolly <st...@gmail.com> on 2010/07/02 10:52:14 UTC

Re: Activating a profile in settings.xml based on a property set in pom.xml?

profile activation is based on _SYSTEM_ properties.

you cannot activate profiles based on properties defined in your pom

you cannot activate profiles based on system properties defined after the
build plan has started execution

-Stephen

On 2 July 2010 08:37, Søren Krogh Neigaard <
Soeren.Krogh.Neigaard@systematic.com> wrote:

> Hi
>
> I would like to activate (or not) a profile in my settings.xml base don
> which profile is active in my pom.xml. The active profile is determined by
> either activated by default, or by setting a -P argument to maven. How can I
> do this?
>
> In my pom.xml I also set a <env>production</env> in my production profile
> and so on, can I use this to activate profiles in settings.xml, or how do I
> do this?
>
> Med venlig hilsen / Kind regards
>
>
> Søren Krogh Neigaard
> Systems Engineer
>
> Søren Frichs Vej 39, 8000 Aarhus C
> Denmark
>
> Mobile +4541965252
> soeren.krogh.neigaard@systematic.com
> www.systematic.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Activating a profile in settings.xml based on a property set in pom.xml?

Posted by sebb <se...@gmail.com>.
On 10 July 2010 08:20, Zac Thompson <za...@gmail.com> wrote:
> I think a concrete example of what you want to do would be helpful.
> You can certainly use profiles to selectively activate sections in
> settings.xml, but I don't understand what you mean by "I would like to
> activate (or not) a profile in my settings.xml based on which profile
> is active in my pom.xml" ... if you are using mvn -P then you can just
> specify them both?

Or just use the same profile name in both?

> On Fri, Jul 2, 2010 at 2:23 AM, Søren Krogh Neigaard
> <So...@systematic.com> wrote:
>> Hm alright, are there really no way that I can, based on my active profile, specify what properties to use or not use from my settings.xml? I mean, I have different filters to filter in the correct values here and there based on my active profile, but a few values are specific pr. Developer and are therefore in each developers settings.xml, but when I make a build for a testserver or other server then I want to overwrite the values defined in settings.xml.
>>
>> Please help :)
>>
>> -----Original Message-----
>> From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com]
>> Sent: 2. juli 2010 10:52
>> To: Maven Users List
>> Subject: Re: Activating a profile in settings.xml based on a property set in pom.xml?
>>
>> profile activation is based on _SYSTEM_ properties.
>>
>> you cannot activate profiles based on properties defined in your pom
>>
>> you cannot activate profiles based on system properties defined after the
>> build plan has started execution
>>
>> -Stephen
>>
>> On 2 July 2010 08:37, Søren Krogh Neigaard <
>> Soeren.Krogh.Neigaard@systematic.com> wrote:
>>
>>> Hi
>>>
>>> I would like to activate (or not) a profile in my settings.xml base don
>>> which profile is active in my pom.xml. The active profile is determined by
>>> either activated by default, or by setting a -P argument to maven. How can I
>>> do this?
>>>
>>> In my pom.xml I also set a <env>production</env> in my production profile
>>> and so on, can I use this to activate profiles in settings.xml, or how do I
>>> do this?
>>>
>>> Med venlig hilsen / Kind regards
>>>
>>>
>>> Søren Krogh Neigaard
>>> Systems Engineer
>>>
>>> Søren Frichs Vej 39, 8000 Aarhus C
>>> Denmark
>>>
>>> Mobile +4541965252
>>> soeren.krogh.neigaard@systematic.com
>>> www.systematic.com
>
> ---------------------------------------------------------------------
> 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


Re: Activating a profile in settings.xml based on a property set in pom.xml?

Posted by Zac Thompson <za...@gmail.com>.
I think a concrete example of what you want to do would be helpful.
You can certainly use profiles to selectively activate sections in
settings.xml, but I don't understand what you mean by "I would like to
activate (or not) a profile in my settings.xml based on which profile
is active in my pom.xml" ... if you are using mvn -P then you can just
specify them both?

On Fri, Jul 2, 2010 at 2:23 AM, Søren Krogh Neigaard
<So...@systematic.com> wrote:
> Hm alright, are there really no way that I can, based on my active profile, specify what properties to use or not use from my settings.xml? I mean, I have different filters to filter in the correct values here and there based on my active profile, but a few values are specific pr. Developer and are therefore in each developers settings.xml, but when I make a build for a testserver or other server then I want to overwrite the values defined in settings.xml.
>
> Please help :)
>
> -----Original Message-----
> From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com]
> Sent: 2. juli 2010 10:52
> To: Maven Users List
> Subject: Re: Activating a profile in settings.xml based on a property set in pom.xml?
>
> profile activation is based on _SYSTEM_ properties.
>
> you cannot activate profiles based on properties defined in your pom
>
> you cannot activate profiles based on system properties defined after the
> build plan has started execution
>
> -Stephen
>
> On 2 July 2010 08:37, Søren Krogh Neigaard <
> Soeren.Krogh.Neigaard@systematic.com> wrote:
>
>> Hi
>>
>> I would like to activate (or not) a profile in my settings.xml base don
>> which profile is active in my pom.xml. The active profile is determined by
>> either activated by default, or by setting a -P argument to maven. How can I
>> do this?
>>
>> In my pom.xml I also set a <env>production</env> in my production profile
>> and so on, can I use this to activate profiles in settings.xml, or how do I
>> do this?
>>
>> Med venlig hilsen / Kind regards
>>
>>
>> Søren Krogh Neigaard
>> Systems Engineer
>>
>> Søren Frichs Vej 39, 8000 Aarhus C
>> Denmark
>>
>> Mobile +4541965252
>> soeren.krogh.neigaard@systematic.com
>> www.systematic.com

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


RE: Activating a profile in settings.xml based on a property set in pom.xml?

Posted by Søren Krogh Neigaard <So...@systematic.com>.
Hm alright, are there really no way that I can, based on my active profile, specify what properties to use or not use from my settings.xml? I mean, I have different filters to filter in the correct values here and there based on my active profile, but a few values are specific pr. Developer and are therefore in each developers settings.xml, but when I make a build for a testserver or other server then I want to overwrite the values defined in settings.xml.

Please help :)

Med venlig hilsen / Kind regards 


Søren Krogh Neigaard
Systems Engineer

Søren Frichs Vej 39, 8000 Aarhus C
Denmark 

Mobile +4541965252
soeren.krogh.neigaard@systematic.com
www.systematic.com


-----Original Message-----
From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com] 
Sent: 2. juli 2010 10:52
To: Maven Users List
Subject: Re: Activating a profile in settings.xml based on a property set in pom.xml?

profile activation is based on _SYSTEM_ properties.

you cannot activate profiles based on properties defined in your pom

you cannot activate profiles based on system properties defined after the
build plan has started execution

-Stephen

On 2 July 2010 08:37, Søren Krogh Neigaard <
Soeren.Krogh.Neigaard@systematic.com> wrote:

> Hi
>
> I would like to activate (or not) a profile in my settings.xml base don
> which profile is active in my pom.xml. The active profile is determined by
> either activated by default, or by setting a -P argument to maven. How can I
> do this?
>
> In my pom.xml I also set a <env>production</env> in my production profile
> and so on, can I use this to activate profiles in settings.xml, or how do I
> do this?
>
> Med venlig hilsen / Kind regards
>
>
> Søren Krogh Neigaard
> Systems Engineer
>
> Søren Frichs Vej 39, 8000 Aarhus C
> Denmark
>
> Mobile +4541965252
> soeren.krogh.neigaard@systematic.com
> www.systematic.com
>
>
> ---------------------------------------------------------------------
> 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