简体   繁体   中英

Is this an issue with mvn release:prepare

I have added the following scm tag to my master pom:

<scm>
    <developerConnection>
       scm:svn:http://<server>/svn/<svnpath>/${project.artifactId}/trunk
    </developerConnection>
</scm>

I thought that this was neat. The projects all hanging off the master all adopt the path strategy.

When I come to do a release:prepare though on a child project it fails.

The child POM ends up with an scm tag added to it in the format:

<scm>
    <developerConnection>
        scm:svn:http://<server>/svn/<svnpath>/<artifact>/tags/v1.0.0
    </developerConnection>
</scm>

The subsequesnt svn commandline then tries to tag from the tag and fails:

[INFO] Executing: cmd.exe /X /C "svn --non-interactive copy --file C:\DOCUME~1\<me>\LOCALS~1\Temp\maven-scm-1302559010.commit http://<server>/svn/<svnpath>/<artifact>/tags/v1.0.0 http://<server>/svn/<svnpath>/<artifact>/tags/v1.0.0"

Q1. Is this a bug with maven release? Q2. If its not a bug, am I not allowed to define the scm tag in the master as I have done?

Hardcoding the scm tag in the child actually fixes it but as we have many child projects I would prefer to define this in the master pom if possible.

First it is not a bug. The intention is that every project has it's own SCM area which contains the correct information. Apart from that during the release plugin cycle the information is replaced from things like:

<scm>
    <developerConnection>scm:svn:http://<server>/project/trunk</developerConnection>
</scm>

into the following:

<scm>
    <developerConnection>scm:svn:http://<server>/project/tags/xyz-1.0.0</developerConnection>
</scm>

Furthermore the idea you had to put the information into your parent (master pom) like this:

<scm>
    <developerConnection>
       scm:svn:http://<server>/svn/<svnpath>/${project.artifactId}/trunk
    </developerConnection>
</scm>

is replaced by the release of your master-pom into something like this:

<scm>
    <developerConnection>
       scm:svn:http://<server>/svn/<svnpath>/master/tags/1.0.0
    </developerConnection>
</scm>

which means every child module would use the above which is definitiv wrong. So you have to set in every project the scm area separately.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM