I guess you didn't see my reply to someone else explaining why I needed to flip true to false and false to true. Here is the snippet of that explanation again: ******* 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. ******
BTW, in my case, I want createDb=false by default and only if the user specifies on the command line -DcreateDb=true - only then do I want to kick off execution of the SQL statements. The this whole thing was to turn the "language"/"terminology" around and make it from the developer's perspective instead of the plugin's prospective. I realize, it's not a huge deal, just a bit counter-intuitive. Thanks, Yaakov. On Thu, Nov 12, 2009 at 12:39 AM, Anders Hammar <[email protected]> wrote: > 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 <[email protected]>wrote: > >> On Wed, Nov 11, 2009 at 6:19 PM, Tony Chemit <[email protected]> wrote: >> > Le Wed, 11 Nov 2009 18:07:31 -0500, >> > Yaakov Chaikin <[email protected]> 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: [email protected] >> For additional commands, e-mail: [email protected] >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
