Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven Release Plugin - prepare creates tag of Snapshot version instead of release version

I have following project structure:

  • framework
    • framework-parent-pom
    • framework-something
    • ...

In the pom.xml of framework-parent-pom I have defined following plugin:

<plugin>
    <artifactId>maven-release-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
        <branchBase>http://.../svn/REPO/branches/framework</branchBase>
        <tagBase>http://.../svn/REPO/tags/releases/framework</tagBase>
        <tagNameFormat>release-@{project.version}</tagNameFormat>
        <releaseProfiles>release</releaseProfiles>
    </configuration>
</plugin>

And following SCM:

<scm>
    <developerConnection>scm:svn:http://.../svn/REPO/trunk/framework/framework-parent-pom</developerConnection>
</scm>

When I run following command...

mvn release:prepare -DautoVersionSubmodules=true -Darguments="-DskipTests" -Dresume=false

...everything seems to go well.

Locally the JAR's with the release version were created and the POM's are nicely updated to the next SNAPSHOT version. Also in SVN, at first sight it seems ok. The tag has been created with all the framework projects inside it.

However, when looking at the POM's of the tag I see that they still have the initial snapshot version as version. This then of course causes the perform step to build the snapshot version and not the release version.

What am I doing wrong?

like image 389
Stijn Geukens Avatar asked May 20 '13 13:05

Stijn Geukens


2 Answers

I find the workaround in the maven-release-plugin issue tracker MRELEASE-812 :

In my case the change was :

       <plugin>
         <artifactId>maven-release-plugin</artifactId>
-        <version>2.2.2</version>
+        <version>2.4.1</version>
         <configuration>
           <releaseProfiles>release</releaseProfiles>
           <goals>install animal-sniffer:check deploy site</goals>
         </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.maven.scm</groupId>
+            <artifactId>maven-scm-api</artifactId>
+            <version>1.8.1</version>
+          </dependency>
+          <dependency>
+            <groupId>org.apache.maven.scm</groupId>
+            <artifactId>maven-scm-provider-gitexe</artifactId>
+            <version>1.8.1</version>
+          </dependency>
+        </dependencies>
       </plugin>
like image 139
David Bernard Avatar answered Sep 22 '22 13:09

David Bernard


I had a similar problem to this. It was tagging the snapshot version because it wasn't committing the POM change before tagging.

I found it would only work if I used the following configuration options:

<remoteTagging>false</remoteTagging>
<suppressCommitBeforeTag>false</suppressCommitBeforeTag>
like image 24
user2813050 Avatar answered Sep 21 '22 13:09

user2813050