I had a look at the new release plugin, saw what you mean, It will update
the version back to SNAPSHOT, nice little feature that was missing in maven
1.
Thanks for your help
On 08/03/07, Daniel Beland <[EMAIL PROTECTED]> wrote:
Hi,
I am trying to migrate our projects to maven 2.0.5 (have been using maven
1 for 2 years now).
I would like to know how I can invoke maven to package the artifact only
when the version does not contain SNAPSHOT, and install it if it contains
SNAPSHOT.
In maven 1 I was using a goal like this:
<goal name="jar:cruisecontrol">
<j:if test="${not(pom.currentVersion.endsWith('SNAPSHOT'))}">
<ant:echo message="Create jar only"/>
<attainGoal name="jar"/>
</j:if>
<j:if test="${pom.currentVersion.endsWith('SNAPSHOT')}">
<ant:echo message="Install SNAPSHOT jar"/>
<attainGoal name="jar:install"/>
</j:if>
</goal>
This is because I do not want cruise control to install an artifact if it
is not a SNAPSHOT. (Released version should always be downloaded from our
central repository).
It happened too many times that developers forget to change the version to
SNAPSHOT after a release, and we overwrite the local artifact and break the
build of other modules.
Profiles cannot be called based on ${ pom.version} ending with SNAPSHOT.
I checked the plugin development, but I didn't find how we can alter the
goals from a plugin.
Someone has an idea how I can attain this?
Thanks,
Daniel