maven-release-plugin tag creation

Dormouse

I just used maven-release-plugin to release a version, obviously :) The scm configuration in my parent pom is as follows:

<scm>
    <developerConnection>scm:svn:http:/localhost/svn/project/trunk/project/3. Implementation/02 Source code</developerConnection>
</scm>

As you can see, after trunk we have several more folders (RUP-style) before reaching the source code.

A mvn release:prepare results in the following scm configuration:

<scm>
    <developerConnection>scm:svn:http://localhost/svn/project/tags/project-1.0.0/02 Source code</developerConnection>
</scm>

So, somehow, maven-release-plugin manages to replace trunk/project/3. Implementation/02 Source code with tags/project-1.0.0/02 Source code.

Why would this not be tags/project-1.0.0, as I would expect? If I would run mvn release:perform the plugin would checkout the entire 3. Implementation directory.

For reference, my plugin definition is as follows:

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
    <version>2.5</version>
        <configuration>
            <tagBase>http://localhost/svn/project/tags</tagBase>
        </configuration>
    </plugin>
</plugins>
Dormouse

Right, I figured out what causes this, looking at the maven-release-manager source code. When rewriting the developerConnection value, the RewritePomsForReleasePhase class calculates the number of subdirectories we need to remove from the developerConnectionUrl to get to the root of our project, based on the local project. Now there are two problems with this approach:

  1. There is no guarantee the local depth will match the remote one. Although this may be best practice.
  2. The working dir (from where mvn is called) does not have to be in the root of the project.

Both apply to my situation. I checked out the project two directories less deep than remote. To clarify: http://localhost/project/3. Implementation/02 Source code was checked out to D:\workspace\project

Also, we have a project-parent dir containing our parent pom.

So now it determines we are 1 deep by looking at the local structure (from work dir, i.e. project-parent, to project dir) and applies this to the developerConnection url. Then it does a substring on the original developerConnection with the result and ends up with 02 Source code in my case.

So long story less long: maven-release-plugin does not work as expected when the local directory structure does not match the remote one. Now I have to checkout honoring the server path and also create a new pom, or move the parent pom to the project root to get it to work...

EDIT: Moving the pom to the project base dir would probably fix the issue, leaving the developerConnection url unchanged. Will confirm this for the next release.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

maven-release-plugin tag creation

From Dev

Maven Release-plugin "tag already exists" for nonexistant tag

From Dev

Maven Release-plugin "tag already exists" for nonexistant tag

From Dev

Hooking custom maven plugin with maven release plugin

From Dev

Hooking custom maven plugin with maven release plugin

From Dev

How to set tag for Maven release

From Dev

Maven release plugin git credentials

From Dev

Failure build on Maven release plugin

From Dev

Maven Release Plugin - Access denied

From Dev

Maven Release Plugin Milestone Support

From Dev

gradle-release plugin + maven publishing plugin

From Dev

About maven plugin version tag

From Dev

About maven plugin version tag

From Dev

Maven release:prepare doesn't change <tag>

From Dev

Creating release tag with Maven/Jenkins/Git

From Dev

Creating release tag with Maven/Jenkins/Git

From Dev

maven release plugin and command line arguments

From Dev

Maven: Release Plugin Does Not Commit Updated Versions

From Dev

Maven release plugin ignores releaseVersion attribute

From Dev

maven-release-plugin deploys snapshot to archiva

From Dev

Maven Release Plugin use in Jenkins Pipeline

From Dev

how to make maven release plugin skip tests?

From Dev

Maven release plugin - how to publish only a snapshot?

From Dev

Maven Release Plugin Pushing Tags To Wrong Repo

From Dev

Maven: Release Plugin Does Not Commit Updated Versions

From Dev

Add maven-release-plugin to Android Studio

From Dev

Exclude release candidates in Versions Maven Plugin

From Dev

Jenkins / Maven Release Plugin SVN - Credentials

From Dev

Maven release plugin - how to bump version of release project

Related Related

HotTag

Archive