Ok, I'll share what exactly is going on with everyone else...

The maven docs says this about activating profiles through a property:
*********
Currently, this detection is limited to prefix-matching of the JDK
version, the presence of a system property or the value of a system
property. Here are some examples.
*********

So, it's ONLY system properties which this applies to! Bummer! :-(

Yaakov.

On Wed, Nov 11, 2009 at 6:07 PM, Yaakov Chaikin
<[email protected]> wrote:
> Hmm... Just tried specifying <createDb>false</createDb> in my
> settings.xml and it STILL does NOT activate any profiles! Anyone has
> any idea of what's going on here?
>
> Thanks in advance for your help.
>
> Yaakov.
>
> On Wed, Nov 11, 2009 at 5:44 PM, Yaakov Chaikin
> <[email protected]> wrote:
>> Hi,
>>
>> I am clearly not understanding how properties propagate in maven...
>>
>> I have a multi-module project where I have a root pom.xml
>> (<packaging>pom</packaging>) and a number of child modules.
>>
>> In my root pom.xml I have this:
>> <properties>
>>  <createDb>false</createDb>
>> </properties>
>>
>>
>> In one of the my child module's pom.xml I have the following:
>>
>> ...
>> <profiles>
>>  <profile>
>>    <id>SkipDbCreationIsTrue</id>
>>    <activation>
>>        <property>
>>           <name>createDb</name>
>>           <value>false</name>
>>        </property>
>>     </activation>
>>     <properties>
>>         <skipDbCreation>true</skipDbCreation>
>>     </properties>
>>   </profile>
>>
>>    <profile>
>>    <id>SkipDbCreationIsFalse</id>
>>    <activation>
>>        <property>
>>           <name>createDb</name>
>>           <value>true</name>
>>        </property>
>>     </activation>
>>     <properties>
>>         <skipDbCreation>false</skipDbCreation>
>>     </properties>
>>   </profile>
>> <profiles>
>> ...
>>
>> When I do mvn help:active-profiles neither of these profiles are
>> active! However, when I specify the property directly on the command
>> line, depending on its value, the correct profile gets activated. It's
>> as if 'createDb' property, which I am using to do activation, is not
>> there at the time maven decides which profiles to use.
>>
>> I could place the 'createDb' property into settings.xml, but I don't
>> want to do that for reasons outside the scope of this question.
>>
>> Can anyone spot what I am doing wrong here? I already checked the
>> spelling of the property in both places and it's correct...
>>
>> Any ideas anyone?
>>
>> Thanks,
>> Yaakov.
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to