On Wed, Nov 11, 2009 at 6:19 PM, Tony Chemit <che...@codelutin.com> wrote:
> Le Wed, 11 Nov 2009 18:07:31 -0500,
> Yaakov Chaikin <yaakov.chai...@gmail.com> a écrit :
>
>> 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.
>>
> It seems weird to me to use 2 profile to do the same thing ?

It doesn't do the SAME thing. First profile creates a property
skipDbCreation with value TRUE, second creates the same property with
the value FALSE.

Basically, it's all because of the maven-sql-plugin. It has an element
<skip>....</skip>, so execution of SQL scripts can be skipped. It's
very annoying and counter-intuitive to have to specify a property (on
a command line) when you actually want to recreate your database that
says "skipDbCreation=false"... That feels like double negative. It's
much more intuitive to say -DcreateDb=true instead.

So, this whole hack is to basically flip the value of 'createDb' into
its opposite. If it's true, the new property will be false, etc.

> why do you want to use 2 profiles ? Moreover why using a profile ?
> Could you not just use your property createDb ? and override it in your child 
> pom ?

See what I wrote above as the answer to this.

In the end of the day, the answer to my problem is that profile
activation can't be done by a property that is not inserted into the
System properties. So, when you specify it on a command line, it works
because it becomes a System property.

Yaakov.

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

Reply via email to