You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Nau, Mike" <Mi...@intuit.com> on 2009/07/22 02:08:06 UTC

Adding groupid to the maven release plugin's scm tag

Hi All,

I'm looking into adding the artifact groupid to the scm tag created by the maven release plugin during the release:prepare goal. I've gotten pretty close with the following configuration:

<groupId>com.foo</groupId>
<artifactId>bar </artifactId>
<version>1.0.0-SNAPSHOT</version>

<configuration>
  <tag>${pom.groupId}:${pom.artifactId}-${pom.version}</tag>
</configuration>

The only problem with this is ${pom.version} is resolving to the next snapshot version. So for example if I run the release:prepare and the current version of the pom is 1.0.0-SNAPSHOT the tag is applied to our scm system as com.foo:bar-1.0.1-SNAPSHOT, instead of com.foo:bar-1.0.0. 

I tried using ${releaseVersion} instead of ${pom.version} based on the details here: http://maven.apache.org/plugins/maven-release-plugin/prepare-mojo.html#releaseVersion. But that property is not valid - it dereferences to null in this case. 

I want to include the groupId in the tag to avoid and potential naming conflicts with other projects. Using just the artifactid and the version aren't enough to ensure a project's scm tag won't collide with another projects scm tag. 

We are using Perforce as our scm provider so period's in the tag\label names are not a problem. We are running the release goals in batch mode. 

Any ideas?

Thanks,
-Mike