Pulak Agrawal
Pulak Agrawal

Reputation: 2481

Maven release plugin creating recursive directories in svn

I am using maven-release-plugin 2.3.2 and able to prepare and perform release . The problem is this.

SVN Repo: http://svnserver:8080/myrepo/test/projectA

Project A         
   |
    branches/
    tags/
    trunk/

When I do a mvn release:perform the first time it'll create this structure inside the tags/ folder

branches/
tags/
   |
    ProjectA_1.0.0
        | 
        branches/ <structure from the parent branches/ folder>
        tags/
        trunk/

When I do a mvn release:perform the second time , this is the output

branches/
tags/
   |
    ProjectA_1.0.0
        | 
        branches/<structure from the parent branches/ folder>
        tags/
        trunk/
    ProjectA_1.0.1
        | 
        branches/<structure from the parent branches/ folder>
        tags/ProjectA_1.0.0/branches/<structure from the parent branches/ folder>
        tags/ProjectA_1.0.0/tags/
        tags/ProjectA_1.0.0/trunk
        trunk/

and so on ... where the whole 1.0.1 will be copied inside 1.0.2, till I have a recursive nightmare :)

Though if I goto my <releases> repository in Nexus, everything is alright and I see clean directories like

1.0.0
1.0.1
1.0.2

with correct artifacts inside them.


I have tested this using the plugin directly on the command line and from Jenkins using M2 release plugin. Same result. Which points me to the direction of wrong configuration somewhere and not how or where I am calling it from.


What I am doing wrong with the plugin or scm tag ?

Upvotes: 1

Views: 686

Answers (1)

khmarbaise
khmarbaise

Reputation: 97359

You have to define the trunk of the project which you like to release and configure that into the scm area of your pom.xml:

Which means to define:

<scm>
  <connection>scm:svn:http://svnserver:8080/myrepo/test/projectA/trunk</connection>
  <developerConnection>scm:svn:http://svnserver:8080/myrepo/test/projectA/trunk</developerConnection>
</scm>

If you have a multi-module build you have to define that only in the parent and not in the childs.

Upvotes: 4

Related Questions