Ok, here what you should do:

1) define a property, let's say "skip.db.creation" and define a default
value of false.
2) bind the plugin to the appropriate phase. Configure it and use the
property above for the skip param.

No, if you run mvn install for instance, the default behavior will kick in
which is create he db. If you DON'T want the db to be created, you just run:
mvn install -Dskip.db.creation=true

You could use a profile to set the property to true instead, if you rather
go that way. You would then active the profile from the command lite
(instead of overriding the property value), like tis:
mvn install -Ptheprofilename

/Anders

On Thu, Nov 12, 2009 at 00:28, Yaakov Chaikin <yaakov.chai...@gmail.com>wrote:

> 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