Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven pom.xml, SCM and release

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

like image 588
AdrianS Avatar asked Mar 01 '12 14:03

AdrianS


People also ask

What is SCM in Maven POM?

Maven SCM supports Maven plugins (for example maven-release-plugin) and other tools by providing them with a common API for source code management operations. You can look at the list of SCMs for more information on using Maven SCM with your favorite SCM tool.

What is SCM connection in POM XML?

Assuming that SCM has been configured in the pom. xml and the project directory is managed by a SCM, invoking the checkin goal in the scm will start the commit process for all configured sources in your pom. xml. The files should be added beforehand by an external scm client.

What is release in Maven?

Introduction. The main aim of the maven-release plugin is to provide a standard mechanism to release project artifacts outside the immediate development team. The plugin provides basic functionality to create a release and to update the project's SCM accordingly.

What is Mvn release prepare?

mvn release:prepare This command prepares for a release in SCM. It goes through several phases to ensure the POM is ready to be released and then creates a tag in SVN which can be used by release:perform to make a release.


2 Answers

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>
like image 110
MaDa Avatar answered Sep 20 '22 13:09

MaDa


just wanted to say that the tagBase parameter is just relevant for SVN! (CVS doesn't use it eg.)

like image 23
Hannes Kogler Avatar answered Sep 21 '22 13:09

Hannes Kogler