views:

242

answers:

1

Hi all,

I would like in a maven2 POM to define a property with a different value if I am packaging a SNAPSHOT or a RELEASE (a non SNAPSHOT) of my project.

I know that I can write a simple Mojo plugin that defines the property regarding the project.version (contains SNAPSHOT or not), but I cannot imagine that in the Maven's hell of existing plugins there is not already one that I could use.

If you know a way of doing this, I would appreciate your help.

Matthieu

A: 

What you want would be done using the Maven2 profiles management. As you can see here, there are several ways to activate a profile in Maven2:

  • Using a specific JDK,
  • Using a specific OS,
  • Giving a parameter in the command line,
  • With a file...

So, as far as I know, there is no way to do what you want without creating a (simple) Mojo plugin...

romaintaz
I would do it then in a simple Mojo. Thanks
Matthieu BROUILLARD