snippets

Monday, September 14, 2009

maven-release-plugin with git

If you want to use Maven's release management with git have a look at this URL
Don Brown's Weblog

However there are a few maven dependency management quirks to iron out in partcular the
maven-scm-provider-gitexe needs later (1.2) version of the maven-scm-api but other parts of maven use the older version which results in the following error:-

java.lang.NoClassDefFoundError: org/apache/maven/scm/ScmTagParameters at org.apache.maven.scm.provider.git.gitexe.command.tag.GitTagCommand.
executeTagCommand(GitTagCommand.java:56) at 
org.apache.maven.scm.command.tag.AbstractTagCommand.
executeCommand(AbstractTagCommand.java:51) at 
org.apache.maven.scm.command.AbstractCommand.
execute(AbstractCommand.java:59)

the way to get around this is to force the release plugin to use the same version
that maven-scm-provider-gitexe uses


I got this working by editing the
<build><pluginmanagement></pluginmanagement></build>
section of my pom to use:

${scmVersion} = 1.2


<project>
....
<properties>
<scmversion>1.2</scmversion>
</properties>
...

<build>
...
<pluginmanagement>
<plugin>
<groupid>org.apache.maven.plugins</groupid>
<artifactid>maven-release-plugin</artifactid>
<version>2.0-beta-9</version>
<dependencies>
<dependency></dependency>
<groupid>org.apache.maven.scm</groupid>
<artifactid>maven-scm-api</artifactid>
<version>${scmVersion}</version>

<dependency>
<groupid>org.apache.maven.scm</groupid>
<artifactid>maven-scm-provider-gitexe</artifactid>
<version>${scmVersion}</version>
</dependency>
</dependencies>

<plugin>
<groupid>org.apache.maven.plugins</groupid>
<artifactid>maven-scm-plugin</artifactid>
<version>${scmVersion}</version>
<dependencies>
<dependency>
<groupid>org.apache.maven.scm</groupid>
<artifactid>maven-scm-provider-gitexe</artifactid>
<version>${scmVersion}</version>
</dependency>
</dependencies>
</plugin><
...
</pluginmanagement>
...
</build>
...
</project> 
 
Cheers. Karl

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home