Issues with Server Names and Maven Subversion scm:tag goal

So I was attempting to set up the Maven SCM plug-in to tag our release builds, but encountered a nasty error when executing the scm:tag goal.  The set up in the project’s pom.xml file is below:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-scm-plugin</artifactId>
    <version>1.0</version>
    <configuration>
        <tagBase>http://svn:8080/svn/jrepo/tags/Frameworks/${project.artifactId}</tagBase>
        <tag>${project.version}</tag>
    </configuration>
</plugin>

The error that was encountered when executing the goal was:

C:\Users\robt\Java-Source\Maven-Conversion\SiestaFramework>mvn scm:tag
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SiestaFramework 1.0.4
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-scm-plugin:1.0:tag (default-cli) @ SiestaFramework ---
[INFO] Final Tag Name: '1.0.4'
[INFO] Executing: svn --non-interactive copy --file C:\Users\robt\AppData\Local\
Temp\maven-scm-1167960694.commit . http://svn:8080/svn/jrepo/tags/Frameworks/SiestaFramework/1.0.4
[INFO] Working directory: C:\Users\robt\Java-Source\Maven-Conversion\SiestaFramework
[ERROR] Provider message:
[ERROR] The svn tag command failed.
[ERROR] Command output:
[ERROR] svn: E235000: In file 'C:\csvn\requirements\subversion\subversion\libsvn _client\commit_util.c' line 474: assertion failed ((copy_mode_root && copy_mode)
 || ! copy_mode_root)

After some research I found some information regarding a potential issue with the SVN client if the server name used in the svn tag command is different than the server name used when the project was checked out.  This was a possibility in my case since our SVN server can be referenced as both svn.lynden.com and mks.lynden.com.

Running the svn info command on the local project directory revealed the following information

C:\Users\robt\Java-Source\Maven-Conversion\SiestaFramework>svn info
Path: .
Working Copy Root Path: C:\Users\robt\Java-Source\Maven-Conversion\SiestaFramework
URL: http://mks:8080/svn/jrepo/trunk/Frameworks/SiestaFramework
Repository Root: http://mks:8080/svn/jrepo
Repository UUID: 14f29ef1-cf71-606c-dc27-f3467c99571f
Revision: 4520
Node Kind: directory
Schedule: normal
Last Changed Author: robt
Last Changed Rev: 4520
Last Changed Date: 2012-02-02 18:07:34 -0800 (Thu, 02 Feb 2012)

As suspected this proved to be the issue.  The project’s pom.xml file defined the server as “svn”, while the project directory was checked out from “mks”.  Changing the tagBase to “mks” cleared the issue and the project could be tagged in SVN using the Maven plugin.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-scm-plugin</artifactId>
    <version>1.0</version>
    <configuration>
        <tagBase>http://svn:8080/svn/jrepo/tags/Frameworks/${project.artifactId}</tagBase>
        <tag>${project.version}</tag>
    </configuration>
</plugin>

2 thoughts on “Issues with Server Names and Maven Subversion scm:tag goal

  1. Thanks for your post! I found the same solution on other sites but only through your nicely presented article I realized that it would fit my problem 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s