Is the maven release: the branch should update the scm url of the branch?

I have this in my pom:

<scm>
    <connection>scm:javasvn:http://url.com/repo/myProject/trunk</connection>
    <developerConnection>scm:javasvn:http://url.com/repo/myProject/trunk</developerConnection>
    <url>http://url.com/websvn/listing.php?repname=repo&amp;path=/myProject/trunk</url>
</scm>

      

When I run:

mvn release:branch -DbranchName=myBranch

      

Here's a branch successfully created:

http://url.com/repo/myProject/branches/myBranch

      

But when I look in the pom.xml of this branch, the "scm" part remains the same as trunk

<scm>
    <connection>scm:javasvn:http://url.com/repo/myProject/trunk</connection>
    <developerConnection>scm:javasvn:http://url.com/repo/myProject/trunk</developerConnection>
    <url>http://url.com/websvn/listing.php?repname=repo&amp;path=/myProject/trunk</url>
</scm>

      

Doc says :

  • Convert SCM information to POM to include final tag assignment

Shouldn't the plugin replace "/ trunk" with "/ branches / myBranch"? Or do we have to do it manually?

+3


source to share


2 answers


I replaced

scm:javasvn:http://...

      

from



scm:svn:http://...

      

And the transformation is happening now.

0


source


The plugin replaces "trunk" with "branch / myBranch", but does not switch your working copy. In the newly created branch, looking at the remote pom.xml, the scm information should have changed for that branch. maven: release fails if it cannot commit changes.

r1643
[maven-release-plugin] prepare for next development iteration
---------------------
r1642
[maven-release-plugin]  copy for branch a-project-1.0
---------------------
r1641
[maven-release-plugin] prepare branch a-project-1.0
---------------------  

      

Is your svn log similar to this revision, did you create a branch?



In this example, r1641 has changed the scm pom information from "trunk" to "branch / a-project-1.0".
r1642 copied the trunk to the branch, creating it.
r1643 changed the pom scm information again from "branch / a-project-1.0" to "trunk" so that you stay in the trunk in your working copy.

When I used maven release and it failed, it always showed an error on the command line and left temporary files on my working copy that need to be removed or cleaned up with mvn -batch-mode release: clean .

Try changing scm.url to " http://url.com/repo/myProject/trunk " instead of http://url.com/websvn/listing.php?repname=repo&path=/myProject/trunk "(I don't think that maven might change your current url setting)
Then go again: mvn --batch-mode -DbranchName = "A_TEST" -Darguments = "- DskipTests = true"
and check for console errors, svn log in svn projects root folder, and check your local working copy changes. If everything should be ok but it is not, check the maven runtime version. I have problems with maven: release and maven 3.0.5 when releasing tags. I only use maven 3.1+ to automate forking / release.

+1


source







All Articles