org.apache.maven.BuildFailureException: No SCM URL was provided to perform the release from

Viewed 29388

I'm using Maven 2.2.1 and I sucessfully ran:

mvn -B release:clean release:prepare

But get the error message:

No SCM URL was provided to perform the release from

when I run:

mvn release:perform

My pom.xml have the scm tags defined correctly:

<scm>
    <url>file:///C:/tmp/svnrepo/myproj/trunk</url>        
    <connection>scm:svn:file:///C:/tmp/svnrepo/myproj/trunk</connection>
    <developerConnection>scm:svn:file:///C:/tmp/svnrepo/myproj/trunk</developerConnection>        
</scm>
6 Answers

The message

No SCM URL was provided to perform the release from

does not mean the SCM URL in the pom.xml!

There are two kinds of SCM-URLS:

  1. Trunk Folder (for development)
  2. Tag Folder (for tagging the release)

In the pom.xml you specify the trunk-folder-url. What the release:perform require is the tag-folder-url. You can specify the parameter -DconnectionUrl.

Usually you are using prepare and perform in one maven call. Prepare do all preparation stuff and will commit some resources to the version-control-system using the comment [maven-release-plugin] prepare release XXX- BUT NOT ALL FILES ARE COMMITTED! One important file is not committed to the version-control-system, the release.properties. This file is used if you omit the -DconnectionUrl.

The problem occourse while perform because the checkout/commit require the release.properties or the -DconnectionUrl respectivly.

You can either:

  1. Specify the tag-url by using -DconnectionUrl or
  2. Call release:prepare release:perform in one shot to rely on the not-committed release.properties

More informations are here

I got this same exception in our CI automation and it turned out to be due to the fact that target/checkout directory already has a release build. For one of the projects, we had to introduce an improvised maven release perform build between the real maven release:prepare and release:perform steps. As part of improvisation the release tag is checked out to target/checkout and what I noticed is that if this directory is left undeleted, it would cause the release:perform to fail with the No SCM URL was provided to perform the release from error. I don't know if it matters, but we also use -DlocalCheckout=true option.

Simply running mvn release:clean release:prepare first, and then mvn release:perform worked for me.

Related