Maven pom.xml, SCM and release

AdrianS picture AdrianS · Mar 1, 2012 · Viewed 10.9k times · Source

I want to do a mvn release:prepare, that will remove the "-SNAPSHOT" from the version and tag it in SVN.

I have these settings in pom.xml:

<scm>
  <connection>scm:svn:http://subversion.local:3690/svn/projects/x/trunk</connection>
  <developerConnection>scm:svn:http://subversion.local:3690/svn/projects/x/tags</developerConnection>
  <url>scm:svn:http://subversion.loi.local:3690/svn/projects/x/tags</url>
 </scm>

But these does not behave like i wanted. Instead it gets everything from /tags are re-tags it under /tags.

So again, what i want, take from HEAD, drop "-SNAPSHOT" and tag it under /tags

Answer

MaDa picture MaDa · Mar 1, 2012

The <scm> tag denotes read-only connection configuration ("connection" element), read-write connection ("developerConnection") and publicly visible URL. It does not have anything to do with tagging. In a small local network it's common for these 3 parameters to be the same.

For tag base, you need to configure the release plugin:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-release-plugin</artifactId>
    <configuration>
        <tagBase>scm:svn:http://subversion.local:3690/svn/projects/x/tags</tagBase>
        <autoVersionSubmodules>true</autoVersionSubmodules>
    </configuration>
</plugin>