maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jürgen (JIRA) <j...@apache.org>
Subject [jira] [Updated] (MRELEASE-939) release:perform uses incorrect ReleaseDescriptor.scmRelativePathProjectDirectory in nested multi-module project
Date Wed, 20 Jan 2016 16:44:39 GMT

     [ https://issues.apache.org/jira/browse/MRELEASE-939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jürgen updated MRELEASE-939:
----------------------------
    Description: 
I recently migrated from svn to git

I have the same issues as described in MRELEASE-927. I use the "pushChanges=false" workaround
mentioned in MRELEASE-767.

I also have an additional problem with an incorrectly determined ReleaseDescriptor.scmRelativePathProjectDirectory
in release:perform

Details:
{code}
project.git/maven-dir/aggregator/pom.xml
project.git/maven-dir/module-a/pom.xml
project.git/maven-dir/module-b/pom.xml
{code}

the main issue is the existence of /maven-dir, so the all the maven project dirs don't live
in the repos root, but in a sub-folder.

on release:perform of aggregator/pom.xml, a checkout happens into target/checkout

{code}
(cd /workspace/project.git/maven-dir/aggregator ; mvn release:perform)
checkout into /workspace/project.git/maven-dir/aggregator/target/checkout/maven-dir/aggregator
{code}

org.apache.maven.shared.release.config.ReleaseDescriptor.setScmRelativePathProjectDirectory(String)
determines scmRelativePathProjectDirectory incorrectly:

{code}
scmResult.getRelativePathProjectDirectory is null

basedir = ReleaseUtil.getCommonBasedir( reactorProjects ) results in:
basedir=/workspace/project.git/maven-dir

rootProjectBasedir = rootProject.getBasedir().getAbsolutePath() results in:
rootProjectBasedir=/workspace/project.git/maven-dir/aggregator

scmRelativePathProjectDirectory = rootProjectBasedir.substring( basedir.length() + 1 ); results
in:
scmRelativePathProjectDirectory=/aggregator

due to the full repos git checkout, it should be:
scmRelativePathProjectDirectory=/maven-dir/aggregator
{code}

existing code worked with svn, because unlike git, release:prepare would tag only the maven-dir
substructure of the svn repos, while in git, it tags the whole repos?

so release:perform with svn checkout of the tag would result in only the /maven-dir/ being
checked out into /target/checkout, leading to e.g.:
/workspace/project.git/maven-dir/aggregator/target/checkout/aggregator

for git, release:perform checkout of tag pulls the whole repos, so its:
/workspace/project.git/maven-dir/aggregator/target/checkout/maven-dir/aggregator

code to determine scmRelativePathProjectDirectory does not account for that.

suggestion: let me define a relative project location for full-repos scm's like git, either
in project/scm or in release-plugin configuration

like
<scmRelativePathProjectDirectory>maven-dir</scmRelativePathProjectDirectory>

I also attaching my current workaround. I made a custom built of maven-release-plugin based
on 2.5.3
I added org.apache.maven.plugins.release.GitperformReleaseMojo
* add a scmRelativePathProjectDirectory configuration param
* set ReleaseDescriptor.scmRelativePathProjectDirectory to param value shortly before its
needed, by injecting a custom CheckoutProjectFromScm phase
* simply setting ReleaseDescriptor.scmRelativePathProjectDirectory in GitperformReleaseMojo.execute()
doesn't work, because ReleaseDescriptor gets constructed/partly-copied/merged/overwritten
later (awful!)...
* prevent wrong ReleaseDescriptor.setScmRelativePathProjectDirectory in CheckoutProjectFromScm.performCheckout
using a ReleaseDescriptor delegate

its not a solution, but it demonstrates what I want to achieve: properly setting ReleaseDescriptor.scmRelativePathProjectDirectory
and not having it overwritten later with wrong value


  was:
I recently migrated from svn to git

I have the same issues as described in MRELEASE-927. I use the "pushChanges=false" workaround
mentioned in MRELEASE-767.

I also have an additional problem with an incorrectly determined ReleaseDescriptor.scmRelativePathProjectDirectory
in release:perform

Details:
{code}
project.git/maven-dir/aggregator/pom.xml
project.git/maven-dir/module-a/pom.xml
project.git/maven-dir/module-b/pom.xml
{code}

the main issue is the existence of /maven-dir, so the all the maven project dirs don't live
in the repos root, but in a sub-folder.

on release:perform of aggregator/pom.xml, a checkout happens into target/checkout

{code}
(cd /workspace/project.git/maven-dir/aggregator ; mvn release:perform)
checkout into /workspace/project.git/maven-dir/aggregator/target/checkout/maven-dir/aggregator
{code}

org.apache.maven.shared.release.config.ReleaseDescriptor.setScmRelativePathProjectDirectory(String)
determines scmRelativePathProjectDirectory incorrectly:

{code}
scmResult.getRelativePathProjectDirectory is null

basedir = ReleaseUtil.getCommonBasedir( reactorProjects ) results in:
basedir=/workspace/project.git/maven-dir

rootProjectBasedir = rootProject.getBasedir().getAbsolutePath() results in:
rootProjectBasedir=/workspace/project.git/maven-dir/aggregator

scmRelativePathProjectDirectory = rootProjectBasedir.substring( basedir.length() + 1 ); results
in:
scmRelativePathProjectDirectory=/aggregator

due to the full repos git checkout, it should be:
scmRelativePathProjectDirectory=/maven-dir/aggregator
{code}

existing code worked with svn, because unlike git, release:prepare would tag only the maven-dir
substructure of the svn repos, while in git, it tags the whole repos?

so release:perform with svn checkout of the tag would result in only the /maven-dir/ being
checked out into /target/checkout, leading to e.g.:
/workspace/project.git/maven-dir/aggregator/target/checkout/aggregator

for git, release:perform checkout of tag pulls the whole repos, so its:
/workspace/project.git/maven-dir/aggregator/target/checkout/maven-dir/aggregator

code to determine scmRelativePathProjectDirectory does not account for that.

suggestion: let me define a relative project location for full-repos scm's like git, either
in project/scm or in release-plugin configuration

like
<scmRelativePathProjectDirectory>maven-dir</scmRelativePathProjectDirectory>

I also attaching my current workaround. I made a custom built of maven-release-plugin based
on 2.5.3
I added org.apache.maven.plugins.release.GitperformReleaseMojo
* add a scmRelativePathProjectDirectory configuration param
* set ReleaseDescriptor.scmRelativePathProjectDirectory to param value shortly before its
needed, by injecting a custom CheckoutProjectFromScm phase
* simply setting ReleaseDescriptor.scmRelativePathProjectDirectory in GitperformReleaseMojo.execute()
doesn't work, because ReleaseDescriptor gets constructed/partly-copied/merged/overwritten
later (awful!)...
* prevent wrong ReleaseDescriptor.setScmRelativePathProjectDirectory in using a ReleaseDescriptor
delegate

its not a solution, but it demonstrates what I want to achieve: properly setting ReleaseDescriptor.scmRelativePathProjectDirectory
and not having it overwritten later with wrong value



> release:perform uses incorrect ReleaseDescriptor.scmRelativePathProjectDirectory in nested
multi-module project
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-939
>                 URL: https://issues.apache.org/jira/browse/MRELEASE-939
>             Project: Maven Release Plugin
>          Issue Type: Bug
>          Components: perform
>    Affects Versions: 2.5.3
>            Reporter: Jürgen
>         Attachments: GitperformReleaseMojo.java
>
>
> I recently migrated from svn to git
> I have the same issues as described in MRELEASE-927. I use the "pushChanges=false" workaround
mentioned in MRELEASE-767.
> I also have an additional problem with an incorrectly determined ReleaseDescriptor.scmRelativePathProjectDirectory
in release:perform
> Details:
> {code}
> project.git/maven-dir/aggregator/pom.xml
> project.git/maven-dir/module-a/pom.xml
> project.git/maven-dir/module-b/pom.xml
> {code}
> the main issue is the existence of /maven-dir, so the all the maven project dirs don't
live in the repos root, but in a sub-folder.
> on release:perform of aggregator/pom.xml, a checkout happens into target/checkout
> {code}
> (cd /workspace/project.git/maven-dir/aggregator ; mvn release:perform)
> checkout into /workspace/project.git/maven-dir/aggregator/target/checkout/maven-dir/aggregator
> {code}
> org.apache.maven.shared.release.config.ReleaseDescriptor.setScmRelativePathProjectDirectory(String)
determines scmRelativePathProjectDirectory incorrectly:
> {code}
> scmResult.getRelativePathProjectDirectory is null
> basedir = ReleaseUtil.getCommonBasedir( reactorProjects ) results in:
> basedir=/workspace/project.git/maven-dir
> rootProjectBasedir = rootProject.getBasedir().getAbsolutePath() results in:
> rootProjectBasedir=/workspace/project.git/maven-dir/aggregator
> scmRelativePathProjectDirectory = rootProjectBasedir.substring( basedir.length() + 1
); results in:
> scmRelativePathProjectDirectory=/aggregator
> due to the full repos git checkout, it should be:
> scmRelativePathProjectDirectory=/maven-dir/aggregator
> {code}
> existing code worked with svn, because unlike git, release:prepare would tag only the
maven-dir substructure of the svn repos, while in git, it tags the whole repos?
> so release:perform with svn checkout of the tag would result in only the /maven-dir/
being checked out into /target/checkout, leading to e.g.:
> /workspace/project.git/maven-dir/aggregator/target/checkout/aggregator
> for git, release:perform checkout of tag pulls the whole repos, so its:
> /workspace/project.git/maven-dir/aggregator/target/checkout/maven-dir/aggregator
> code to determine scmRelativePathProjectDirectory does not account for that.
> suggestion: let me define a relative project location for full-repos scm's like git,
either in project/scm or in release-plugin configuration
> like
> <scmRelativePathProjectDirectory>maven-dir</scmRelativePathProjectDirectory>
> I also attaching my current workaround. I made a custom built of maven-release-plugin
based on 2.5.3
> I added org.apache.maven.plugins.release.GitperformReleaseMojo
> * add a scmRelativePathProjectDirectory configuration param
> * set ReleaseDescriptor.scmRelativePathProjectDirectory to param value shortly before
its needed, by injecting a custom CheckoutProjectFromScm phase
> * simply setting ReleaseDescriptor.scmRelativePathProjectDirectory in GitperformReleaseMojo.execute()
doesn't work, because ReleaseDescriptor gets constructed/partly-copied/merged/overwritten
later (awful!)...
> * prevent wrong ReleaseDescriptor.setScmRelativePathProjectDirectory in CheckoutProjectFromScm.performCheckout
using a ReleaseDescriptor delegate
> its not a solution, but it demonstrates what I want to achieve: properly setting ReleaseDescriptor.scmRelativePathProjectDirectory
and not having it overwritten later with wrong value



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message