views:

2982

answers:

8

With my multiproject pom I get an error while running release:prepare. There is nothing fancy about the project setup and every release-step before runs fine. The error I get is:

    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Unable to tag SCM
    Provider message:
    The svn tag command failed.
    Command output:
    svn: Commit failed (details follow):
    svn: File '/repos/june/tags/foo-1.0.2/foo.bar.org/pom.xml' already exists

Any idea where it comes from and how to get around it?

(sorry for duplicate post - first was closed because I didn't formulate it as a question that can be answered. I hope it's ok now.)

EDIT
The maven release plugin takes care of the version handling itself. So when I check the path in the subversion repository the path does not yet exist.

EDIT 2
@Ben: I don't know the server version, however the client is 1.5.2, too.

A: 

As far as I know it is a bug in Subversion 1.5 and not directly related with maven. However a workaround the fixed it for me is to update the local svn repository and run the release:prepare goal again.

Roland Schneider
A: 

It's because you haven't increased the version number - 1.0.2 already exists in your Subversion repo.

Either increment your version or just remove the /repos/june/tags/foo-1.0.2 tag from your repo.

fiddlesticks
A: 

I have the same problem, and doing svn update and running release:prepare works for me as well as a workaround. I am using svn client 1.5.2, but svnserve is still 1.4. Perhaps that is the cause? What is your setup?

Ben
A: 

I spent quite a while fighting with this. Something is different in SVN 1.5.1+ that breaks committing to a tag straight from the working copy - which is exactly what Maven does. There's still a lot of finger-pointing as to who's responsible for fixing the problem.

You can do an 'svn update' and rerun the release command but if you're doing a release:branch, this will cause the release plugin not to return your POM files to their previous state.

The best workaround I know of is to drop back to Subversion 1.5.0.

+1  A: 

Roland, if you haven't seen this already, take a look at John Smart's blog post about this problem. Although the script he proposes is inelegant, it solves the problem:

http://weblogs.java.net/blog/johnsmart/archive/2008/12/subversion_mave.html

The other solution is to use Git. (Me == currently writing about Maven and Git)

tobrien
Thanks for the additional info. I didn't know the blog entry yet.
Roland Schneider
+1  A: 

Potentially useful links:

http://weblogs.java.net/blog/johnsmart/archive/2008/12/subversion_mave.html (previously mentioned)

http://jira.codehaus.org/browse/MRELEASE-427 (the real bug?)

http://jira.codehaus.org/browse/SCM-406 (related bug)

http://olafsblog.sysbsb.de/?p=73 (newer and perhaps more helpful post)

Jesse Glick
+7  A: 

This issue is addressed in the latest version of the maven-release-plugin. Add this to your POM to pull it in.

<build>
  <pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.0-beta-9</version>
      </plugin>
    </plugins>
  </pluginManagement>
</build>

The issue that was fixed is MRELEASE-375.

Dominic Mitchell
A: 

This is fixed in the newest release plugin release, 2.0-beta-9

Brian Fox