[
https://jira.codehaus.org/browse/MRELEASE-871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=344833#comment-344833
]
Gertjan Gaillet commented on MRELEASE-871:
------------------------------------------
Hi
I thought about the same use cases later on and added a few test cases to the
{{org.apache.maven.shared.release.util.ReleaseUtilTest}} class to take them
into account.
Thanks for your advise on
{{org.codehaus.plexus.util.FileUtils.normalize(String)}}, however that doesn't
solve the issue when running on Windows - the plexus library is only made for
Linux paths.
Therefore I normalized the paths using
{{org.apache.commons.io.FilenameUtils.normalize}} which does work for Windows.
Attached the patch that includes the new tests, fixed
{{ReleaseUtil.getBaseWorkingDirectoryParentCount}} and the additional
dependency I've added to the Release Manager project.
Let me know what you think.
> Release Tag wrongly created when invoked pom.xml path contains a '.'
> --------------------------------------------------------------------
>
> Key: MRELEASE-871
> URL: https://jira.codehaus.org/browse/MRELEASE-871
> Project: Maven Release Plugin
> Issue Type: Bug
> Components: perform, scm
> Affects Versions: 2.5
> Environment: RHEL Linux, Windows 7, most probably others
> Reporter: Gertjan Gaillet
> Attachments: MRELEASE-871.patch, ReleaseUtil.java.patch
>
>
> *Issue*
> When invoking the maven release plugin on a pom.xml referenced by a path
> including a '.', the release tag created is incorrect.
> Example: mvn clean release:clean release:prepare release:perform \[options\]
> -f ./pom.xml
> This is true for both modular and hierarchical projects:
> {code}/parent-pom/pom.xml
> /module-a/pom.xml
> /module-b/pom.xml{code}
> and
> {code}/pom.xml <-- this is the parent pom
> /module-a/pom.xml
> /module-b/pom.xml{code}
> When releasing projects with either structure, invoking maven with "-f
> ./parent-pom/pom.xml" and "-f ./pom.xml" respectively, the tag operation
> copies from one level too high. For example if the svn structure is as
> follows:
> {code}/trunk (at v 1.0.0-SNAPSHOT)
> /branches/project-0.1.x (at v 0.1.0-SNAPSHOT)
> /branches/project-0.2.x (at v 0.2.0-SNAPSHOT)
> /tags/project-0.1.0{code}
> and a release is being made from trunk, the tag project-1.0.0 would contain
> the complete svn structure. When a release is being made from
> /branches/project-0.1.x, the tag project-0.1.0 would contain the two branches:
> {code}/branches/project-0.1.x
> /branches/project-0.2.x{code}
> *Root cause*
> After some debugging, I've found that the issue is caused by function
> getBaseWorkingDirectoryParentCount in
> org.apache.maven.shared.release.util.ReleaseUtil.
> I've created a patch (for trunk and 2.5), as attached, and tested it
> successfully on Windows7 and RHEL, with jdk1.6.0_26 and maven 3.0.4.
> Let me know if the patch is OK (we are currently using it without any issue,
> and resolving this bug) and I'll commit it accordingly.
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)