pom scripting tools?

2008-02-02 Thread Cam

hi,

i was wondering if there's any way to do simple scripting in a pom? the 
specific case i'm trying to solve is to generate a database schema name 
based on the version of the project. If my project version is 
0.1-SNAPSHOT i'd like the database to be called 0_1_snapshot since '.' 
and '-' are restricted characters in postgres. i think scripting would 
be the only way to accomplish this otherwise i would have to manually 
set the new database name with every version change.


another case i've got is where i want to negate a boolean property - 
this is in  the case of the sql plugin which has a 'skip' config 
parameter, in my case i want to have a property called 
'init.database.user' which has requires a property of true to activate 
instead of 'init.database.user.skip' which would require a false value. 
trivial i know, but i think it makes the properties a bit more 
intuitive. is there any way i can do boolean operators on properties, 
something like:


init.database.user.skip!${init.database.user}/init.database.user.skip

thanks,
cam


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: pom scripting tools?

2008-02-02 Thread Wayne Fay
You could probably achieve this with a little Beanshell or Groovy
plugin, or Java for that matter. You'd need to bind the property back
to the MavenProject so it would propagate throughout your build.

Wayne

On 2/2/08, Cam [EMAIL PROTECTED] wrote:
 hi,

 i was wondering if there's any way to do simple scripting in a pom? the
 specific case i'm trying to solve is to generate a database schema name
 based on the version of the project. If my project version is
 0.1-SNAPSHOT i'd like the database to be called 0_1_snapshot since '.'
 and '-' are restricted characters in postgres. i think scripting would
 be the only way to accomplish this otherwise i would have to manually
 set the new database name with every version change.

 another case i've got is where i want to negate a boolean property -
 this is in  the case of the sql plugin which has a 'skip' config
 parameter, in my case i want to have a property called
 'init.database.user' which has requires a property of true to activate
 instead of 'init.database.user.skip' which would require a false value.
 trivial i know, but i think it makes the properties a bit more
 intuitive. is there any way i can do boolean operators on properties,
 something like:

 init.database.user.skip!${init.database.user}/init.database.user.skip

 thanks,
 cam


 -
 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]