You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Benson Margulies <bi...@gmail.com> on 2012/10/29 17:22:38 UTC

Overriding a property from a profile

If a profile has a property value set, -D from the command-line does
not win, the profile wins. Does this surprise anyone else?

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


Re: Overriding a property from a profile

Posted by John Patrick <nh...@gmail.com>.
>From memory I think it did fix an issue, should have raised a bug but
I am thinking 18-24 months ago. Will look into it again and raise
defect if still an issue.

On 30 October 2012 13:09, Anders Hammar <an...@hammar.net> wrote:
> I very much hope this doesn't make a difference. If it does, I'd say
> it's a bug that needs to be fixed.
>
> /Anders
>
> On Tue, Oct 30, 2012 at 10:19 AM, John Patrick <nh...@gmail.com> wrote:
>> If you try switching the parameter and profile the other way around,
>> does that then work?
>>
>> -Dbletch=false -Pa
>>
>> On 29 October 2012 21:52, Benson Margulies <bi...@gmail.com> wrote:
>>> On Mon, Oct 29, 2012 at 4:26 PM, Anders Hammar <an...@hammar.net> wrote:
>>>>> With two profiles that disagreed, the order of the profiles names
>>>>> after -Pa,b (or b,a) did not matter.
>>>>
>>>> Correct. The declared order in the pom or settings.xml is the one that counts.
>>>>
>>>>> -Pa -Dbletch=false
>>>>>
>>>>> respected the 'true' in a, not the false from the command line.
>>>>
>>>> I think this surprises me. Did you verify with Maven 2?
>>>
>>> No, all my projects now require M3. I guess I need to build a test
>>> case and JIRA.
>>>
>>>>
>>>> /Anders
>>>>
>>>>>
>>>>>
>>>>> On Mon, Oct 29, 2012 at 12:47 PM, John Patrick <nh...@gmail.com> wrote:
>>>>>> How are the profiles being activated? Command line -P or via
>>>>>> activations, or a mix?
>>>>>>
>>>>>> About 6 months ago I had issues using -P and -D and fix it by getting
>>>>>> all -D options we might need to use into profiles and then just
>>>>>> remembering specific orders of profiles.
>>>>>>
>>>>>> John
>>>>>>
>>>>>> On 29 October 2012 16:33, Anders Hammar <an...@hammar.net> wrote:
>>>>>>> Yes (I think). Did you test with both Maven 3 and 2?
>>>>>>>
>>>>>>> /Anders
>>>>>>>
>>>>>>> On Mon, Oct 29, 2012 at 4:22 PM, Benson Margulies <bi...@gmail.com> wrote:
>>>>>>>> If a profile has a property value set, -D from the command-line does
>>>>>>>> not win, the profile wins. Does this surprise anyone else?
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> 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
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>
>> ---------------------------------------------------------------------
>> 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
>

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


Re: Overriding a property from a profile

Posted by Anders Hammar <an...@hammar.net>.
I very much hope this doesn't make a difference. If it does, I'd say
it's a bug that needs to be fixed.

/Anders

On Tue, Oct 30, 2012 at 10:19 AM, John Patrick <nh...@gmail.com> wrote:
> If you try switching the parameter and profile the other way around,
> does that then work?
>
> -Dbletch=false -Pa
>
> On 29 October 2012 21:52, Benson Margulies <bi...@gmail.com> wrote:
>> On Mon, Oct 29, 2012 at 4:26 PM, Anders Hammar <an...@hammar.net> wrote:
>>>> With two profiles that disagreed, the order of the profiles names
>>>> after -Pa,b (or b,a) did not matter.
>>>
>>> Correct. The declared order in the pom or settings.xml is the one that counts.
>>>
>>>> -Pa -Dbletch=false
>>>>
>>>> respected the 'true' in a, not the false from the command line.
>>>
>>> I think this surprises me. Did you verify with Maven 2?
>>
>> No, all my projects now require M3. I guess I need to build a test
>> case and JIRA.
>>
>>>
>>> /Anders
>>>
>>>>
>>>>
>>>> On Mon, Oct 29, 2012 at 12:47 PM, John Patrick <nh...@gmail.com> wrote:
>>>>> How are the profiles being activated? Command line -P or via
>>>>> activations, or a mix?
>>>>>
>>>>> About 6 months ago I had issues using -P and -D and fix it by getting
>>>>> all -D options we might need to use into profiles and then just
>>>>> remembering specific orders of profiles.
>>>>>
>>>>> John
>>>>>
>>>>> On 29 October 2012 16:33, Anders Hammar <an...@hammar.net> wrote:
>>>>>> Yes (I think). Did you test with both Maven 3 and 2?
>>>>>>
>>>>>> /Anders
>>>>>>
>>>>>> On Mon, Oct 29, 2012 at 4:22 PM, Benson Margulies <bi...@gmail.com> wrote:
>>>>>>> If a profile has a property value set, -D from the command-line does
>>>>>>> not win, the profile wins. Does this surprise anyone else?
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> 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
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>
> ---------------------------------------------------------------------
> 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: Overriding a property from a profile

Posted by John Patrick <nh...@gmail.com>.
If you try switching the parameter and profile the other way around,
does that then work?

-Dbletch=false -Pa

On 29 October 2012 21:52, Benson Margulies <bi...@gmail.com> wrote:
> On Mon, Oct 29, 2012 at 4:26 PM, Anders Hammar <an...@hammar.net> wrote:
>>> With two profiles that disagreed, the order of the profiles names
>>> after -Pa,b (or b,a) did not matter.
>>
>> Correct. The declared order in the pom or settings.xml is the one that counts.
>>
>>> -Pa -Dbletch=false
>>>
>>> respected the 'true' in a, not the false from the command line.
>>
>> I think this surprises me. Did you verify with Maven 2?
>
> No, all my projects now require M3. I guess I need to build a test
> case and JIRA.
>
>>
>> /Anders
>>
>>>
>>>
>>> On Mon, Oct 29, 2012 at 12:47 PM, John Patrick <nh...@gmail.com> wrote:
>>>> How are the profiles being activated? Command line -P or via
>>>> activations, or a mix?
>>>>
>>>> About 6 months ago I had issues using -P and -D and fix it by getting
>>>> all -D options we might need to use into profiles and then just
>>>> remembering specific orders of profiles.
>>>>
>>>> John
>>>>
>>>> On 29 October 2012 16:33, Anders Hammar <an...@hammar.net> wrote:
>>>>> Yes (I think). Did you test with both Maven 3 and 2?
>>>>>
>>>>> /Anders
>>>>>
>>>>> On Mon, Oct 29, 2012 at 4:22 PM, Benson Margulies <bi...@gmail.com> wrote:
>>>>>> If a profile has a property value set, -D from the command-line does
>>>>>> not win, the profile wins. Does this surprise anyone else?
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>
>> ---------------------------------------------------------------------
>> 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
>

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


Re: Overriding a property from a profile

Posted by Benson Margulies <bi...@gmail.com>.
On Mon, Oct 29, 2012 at 4:26 PM, Anders Hammar <an...@hammar.net> wrote:
>> With two profiles that disagreed, the order of the profiles names
>> after -Pa,b (or b,a) did not matter.
>
> Correct. The declared order in the pom or settings.xml is the one that counts.
>
>> -Pa -Dbletch=false
>>
>> respected the 'true' in a, not the false from the command line.
>
> I think this surprises me. Did you verify with Maven 2?

No, all my projects now require M3. I guess I need to build a test
case and JIRA.

>
> /Anders
>
>>
>>
>> On Mon, Oct 29, 2012 at 12:47 PM, John Patrick <nh...@gmail.com> wrote:
>>> How are the profiles being activated? Command line -P or via
>>> activations, or a mix?
>>>
>>> About 6 months ago I had issues using -P and -D and fix it by getting
>>> all -D options we might need to use into profiles and then just
>>> remembering specific orders of profiles.
>>>
>>> John
>>>
>>> On 29 October 2012 16:33, Anders Hammar <an...@hammar.net> wrote:
>>>> Yes (I think). Did you test with both Maven 3 and 2?
>>>>
>>>> /Anders
>>>>
>>>> On Mon, Oct 29, 2012 at 4:22 PM, Benson Margulies <bi...@gmail.com> wrote:
>>>>> If a profile has a property value set, -D from the command-line does
>>>>> not win, the profile wins. Does this surprise anyone else?
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>
> ---------------------------------------------------------------------
> 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: Overriding a property from a profile

Posted by Anders Hammar <an...@hammar.net>.
> With two profiles that disagreed, the order of the profiles names
> after -Pa,b (or b,a) did not matter.

Correct. The declared order in the pom or settings.xml is the one that counts.

> -Pa -Dbletch=false
>
> respected the 'true' in a, not the false from the command line.

I think this surprises me. Did you verify with Maven 2?

/Anders

>
>
> On Mon, Oct 29, 2012 at 12:47 PM, John Patrick <nh...@gmail.com> wrote:
>> How are the profiles being activated? Command line -P or via
>> activations, or a mix?
>>
>> About 6 months ago I had issues using -P and -D and fix it by getting
>> all -D options we might need to use into profiles and then just
>> remembering specific orders of profiles.
>>
>> John
>>
>> On 29 October 2012 16:33, Anders Hammar <an...@hammar.net> wrote:
>>> Yes (I think). Did you test with both Maven 3 and 2?
>>>
>>> /Anders
>>>
>>> On Mon, Oct 29, 2012 at 4:22 PM, Benson Margulies <bi...@gmail.com> wrote:
>>>> If a profile has a property value set, -D from the command-line does
>>>> not win, the profile wins. Does this surprise anyone else?
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>
>> ---------------------------------------------------------------------
>> 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
>

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


Re: Overriding a property from a profile

Posted by Benson Margulies <bi...@gmail.com>.
With two profiles that disagreed, the order of the profiles names
after -Pa,b (or b,a) did not matter.

-Pa -Dbletch=false

respected the 'true' in a, not the false from the command line.


On Mon, Oct 29, 2012 at 12:47 PM, John Patrick <nh...@gmail.com> wrote:
> How are the profiles being activated? Command line -P or via
> activations, or a mix?
>
> About 6 months ago I had issues using -P and -D and fix it by getting
> all -D options we might need to use into profiles and then just
> remembering specific orders of profiles.
>
> John
>
> On 29 October 2012 16:33, Anders Hammar <an...@hammar.net> wrote:
>> Yes (I think). Did you test with both Maven 3 and 2?
>>
>> /Anders
>>
>> On Mon, Oct 29, 2012 at 4:22 PM, Benson Margulies <bi...@gmail.com> wrote:
>>> If a profile has a property value set, -D from the command-line does
>>> not win, the profile wins. Does this surprise anyone else?
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>
> ---------------------------------------------------------------------
> 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: Overriding a property from a profile

Posted by John Patrick <nh...@gmail.com>.
How are the profiles being activated? Command line -P or via
activations, or a mix?

About 6 months ago I had issues using -P and -D and fix it by getting
all -D options we might need to use into profiles and then just
remembering specific orders of profiles.

John

On 29 October 2012 16:33, Anders Hammar <an...@hammar.net> wrote:
> Yes (I think). Did you test with both Maven 3 and 2?
>
> /Anders
>
> On Mon, Oct 29, 2012 at 4:22 PM, Benson Margulies <bi...@gmail.com> wrote:
>> If a profile has a property value set, -D from the command-line does
>> not win, the profile wins. Does this surprise anyone else?
>>
>> ---------------------------------------------------------------------
>> 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
>

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


Re: Overriding a property from a profile

Posted by Anders Hammar <an...@hammar.net>.
Yes (I think). Did you test with both Maven 3 and 2?

/Anders

On Mon, Oct 29, 2012 at 4:22 PM, Benson Margulies <bi...@gmail.com> wrote:
> If a profile has a property value set, -D from the command-line does
> not win, the profile wins. Does this surprise anyone else?
>
> ---------------------------------------------------------------------
> 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