You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Steve Gilbert (JIRA)" <ji...@codehaus.org> on 2009/06/01 07:31:42 UTC

[jira] Created: (MRELEASE-449) Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare

Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare
------------------------------------------------------------------------------------------------

                 Key: MRELEASE-449
                 URL: http://jira.codehaus.org/browse/MRELEASE-449
             Project: Maven 2.x Release Plugin
          Issue Type: Bug
          Components: prepare
    Affects Versions: 2.0-beta-9
            Reporter: Steve Gilbert
            Priority: Critical
         Attachments: maven-release-rewrite-parent-bug.patch, parent_version_rewrite_bug.zip

When a pom has a parent specified with a snapshot version, when "mvn release:prepare" is executed, the version entered by the user when prompted to resolve the parent version is not used when the pom is rewritten.  The parent version remains at the snapshot version in the rewritten pom.

This happens in dry run mode and normal mode.

I will attach a zip file with a simple example/test case that shows the bug.  The steps to reproduce using the zip file:
1. cd to parent
2. execute "mvn install"
3. cd to ../child
4. execute "mvn -DdryRun=true release:prepare" answering "yes" to the first
   "resolve dependencies?" question and then answering with the default to
   all the other questions
5. cat pom.xml.tag noticing the parent SNAPSHOT version has not been replaced

The cause of this appears to be in AbstractRewritePomsPhase.rewriteParent.  This method only consults the mappedVersions Map, however when the release plugin is executed from the command line and the user enters the version number to resolve the snapshot dependency (even using the default provided by the release plugin) the values are stored in the resolvedSnapshotDependencies Map only.

I've modified the code to consult both Maps which is what other methods in the class do when rewriting dependency snapshot revisions.  I have provided a patch with the modified code.  The patch also contains a new test method in RewritePomsForReleasePhaseTest that will fail without the patch and pass with it.

The patch was taken from maven-release 2.0-beta-9 and can be applied with
{code}
patch -p0 < ~/maven-release-rewrite-parent-bug.patch
{code}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MRELEASE-449) Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare

Posted by "Gabriel Falkenberg (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRELEASE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gabriel Falkenberg updated MRELEASE-449:
----------------------------------------

    Attachment: MRELEASE-449.diff

Updated the patch to apply cleanly on trunk (revision 923664).

> Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare
> ------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-449
>                 URL: http://jira.codehaus.org/browse/MRELEASE-449
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0-beta-9
>            Reporter: Steve Gilbert
>            Priority: Critical
>         Attachments: maven-release-rewrite-parent-bug.patch, MRELEASE-449.diff, parent_version_rewrite_bug.zip
>
>
> When a pom has a parent specified with a snapshot version, when "mvn release:prepare" is executed, the version entered by the user when prompted to resolve the parent version is not used when the pom is rewritten.  The parent version remains at the snapshot version in the rewritten pom.
> This happens in dry run mode and normal mode.
> I will attach a zip file with a simple example/test case that shows the bug.  The steps to reproduce using the zip file:
> 1. cd to parent
> 2. execute "mvn install"
> 3. cd to ../child
> 4. execute "mvn -DdryRun=true release:prepare" answering "yes" to the first
>    "resolve dependencies?" question and then answering with the default to
>    all the other questions
> 5. cat pom.xml.tag noticing the parent SNAPSHOT version has not been replaced
> The cause of this appears to be in AbstractRewritePomsPhase.rewriteParent.  This method only consults the mappedVersions Map, however when the release plugin is executed from the command line and the user enters the version number to resolve the snapshot dependency (even using the default provided by the release plugin) the values are stored in the resolvedSnapshotDependencies Map only.
> I've modified the code to consult both Maps which is what other methods in the class do when rewriting dependency snapshot revisions.  I have provided a patch with the modified code.  The patch also contains a new test method in RewritePomsForReleasePhaseTest that will fail without the patch and pass with it.
> The patch was taken from maven-release 2.0-beta-9 and can be applied with
> {code}
> patch -p0 < ~/maven-release-rewrite-parent-bug.patch
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MRELEASE-449) Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare

Posted by "Tom Vaughan (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MRELEASE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=283507#comment-283507 ] 

Tom Vaughan commented on MRELEASE-449:
--------------------------------------

Is there any movement on this?  Was this issue folded in to a later release?

> Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare
> ------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-449
>                 URL: https://jira.codehaus.org/browse/MRELEASE-449
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0-beta-9
>            Reporter: Steve Gilbert
>            Priority: Critical
>         Attachments: maven-release-rewrite-parent-bug.patch, MRELEASE-449.diff, parent_version_rewrite_bug.zip
>
>
> When a pom has a parent specified with a snapshot version, when "mvn release:prepare" is executed, the version entered by the user when prompted to resolve the parent version is not used when the pom is rewritten.  The parent version remains at the snapshot version in the rewritten pom.
> This happens in dry run mode and normal mode.
> I will attach a zip file with a simple example/test case that shows the bug.  The steps to reproduce using the zip file:
> 1. cd to parent
> 2. execute "mvn install"
> 3. cd to ../child
> 4. execute "mvn -DdryRun=true release:prepare" answering "yes" to the first
>    "resolve dependencies?" question and then answering with the default to
>    all the other questions
> 5. cat pom.xml.tag noticing the parent SNAPSHOT version has not been replaced
> The cause of this appears to be in AbstractRewritePomsPhase.rewriteParent.  This method only consults the mappedVersions Map, however when the release plugin is executed from the command line and the user enters the version number to resolve the snapshot dependency (even using the default provided by the release plugin) the values are stored in the resolvedSnapshotDependencies Map only.
> I've modified the code to consult both Maps which is what other methods in the class do when rewriting dependency snapshot revisions.  I have provided a patch with the modified code.  The patch also contains a new test method in RewritePomsForReleasePhaseTest that will fail without the patch and pass with it.
> The patch was taken from maven-release 2.0-beta-9 and can be applied with
> {code}
> patch -p0 < ~/maven-release-rewrite-parent-bug.patch
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MRELEASE-449) Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare

Posted by "Gabriel Falkenberg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRELEASE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=214005#action_214005 ] 

Gabriel Falkenberg edited comment on MRELEASE-449 at 3/16/10 5:22 AM:
----------------------------------------------------------------------

I can confirm that the patch fixes the problem and have updated the patch to apply cleanly on trunk (revision 923664). The updated patch is called2 MRELEASE-449.diff

Are there any plans to include a fix to this problem in a release?

      was (Author: gabriel.falkenberg@gmail.com):
    I can confirm that the patch fixes the problem and have updated the patch to apply cleanly on trunk (revision 923664). 

Are there any plans to include this in a release?
  
> Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare
> ------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-449
>                 URL: http://jira.codehaus.org/browse/MRELEASE-449
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0-beta-9
>            Reporter: Steve Gilbert
>            Priority: Critical
>         Attachments: maven-release-rewrite-parent-bug.patch, MRELEASE-449.diff, parent_version_rewrite_bug.zip
>
>
> When a pom has a parent specified with a snapshot version, when "mvn release:prepare" is executed, the version entered by the user when prompted to resolve the parent version is not used when the pom is rewritten.  The parent version remains at the snapshot version in the rewritten pom.
> This happens in dry run mode and normal mode.
> I will attach a zip file with a simple example/test case that shows the bug.  The steps to reproduce using the zip file:
> 1. cd to parent
> 2. execute "mvn install"
> 3. cd to ../child
> 4. execute "mvn -DdryRun=true release:prepare" answering "yes" to the first
>    "resolve dependencies?" question and then answering with the default to
>    all the other questions
> 5. cat pom.xml.tag noticing the parent SNAPSHOT version has not been replaced
> The cause of this appears to be in AbstractRewritePomsPhase.rewriteParent.  This method only consults the mappedVersions Map, however when the release plugin is executed from the command line and the user enters the version number to resolve the snapshot dependency (even using the default provided by the release plugin) the values are stored in the resolvedSnapshotDependencies Map only.
> I've modified the code to consult both Maps which is what other methods in the class do when rewriting dependency snapshot revisions.  I have provided a patch with the modified code.  The patch also contains a new test method in RewritePomsForReleasePhaseTest that will fail without the patch and pass with it.
> The patch was taken from maven-release 2.0-beta-9 and can be applied with
> {code}
> patch -p0 < ~/maven-release-rewrite-parent-bug.patch
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MRELEASE-449) Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRELEASE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg updated MRELEASE-449:
-------------------------------------

    Fix Version/s:     (was: 2.0)

Moving to a later version.

> Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare
> ------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-449
>                 URL: http://jira.codehaus.org/browse/MRELEASE-449
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0-beta-9
>            Reporter: Steve Gilbert
>            Priority: Critical
>         Attachments: maven-release-rewrite-parent-bug.patch, parent_version_rewrite_bug.zip
>
>
> When a pom has a parent specified with a snapshot version, when "mvn release:prepare" is executed, the version entered by the user when prompted to resolve the parent version is not used when the pom is rewritten.  The parent version remains at the snapshot version in the rewritten pom.
> This happens in dry run mode and normal mode.
> I will attach a zip file with a simple example/test case that shows the bug.  The steps to reproduce using the zip file:
> 1. cd to parent
> 2. execute "mvn install"
> 3. cd to ../child
> 4. execute "mvn -DdryRun=true release:prepare" answering "yes" to the first
>    "resolve dependencies?" question and then answering with the default to
>    all the other questions
> 5. cat pom.xml.tag noticing the parent SNAPSHOT version has not been replaced
> The cause of this appears to be in AbstractRewritePomsPhase.rewriteParent.  This method only consults the mappedVersions Map, however when the release plugin is executed from the command line and the user enters the version number to resolve the snapshot dependency (even using the default provided by the release plugin) the values are stored in the resolvedSnapshotDependencies Map only.
> I've modified the code to consult both Maps which is what other methods in the class do when rewriting dependency snapshot revisions.  I have provided a patch with the modified code.  The patch also contains a new test method in RewritePomsForReleasePhaseTest that will fail without the patch and pass with it.
> The patch was taken from maven-release 2.0-beta-9 and can be applied with
> {code}
> patch -p0 < ~/maven-release-rewrite-parent-bug.patch
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MRELEASE-449) Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare

Posted by "Mike Youngstrom (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRELEASE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=185282#action_185282 ] 

Mike Youngstrom commented on MRELEASE-449:
------------------------------------------

Can this issue please get fixed with beta-10?  it is the only think keeping me from using the release plugin.

> Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare
> ------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-449
>                 URL: http://jira.codehaus.org/browse/MRELEASE-449
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0-beta-9
>            Reporter: Steve Gilbert
>            Priority: Critical
>         Attachments: maven-release-rewrite-parent-bug.patch, parent_version_rewrite_bug.zip
>
>
> When a pom has a parent specified with a snapshot version, when "mvn release:prepare" is executed, the version entered by the user when prompted to resolve the parent version is not used when the pom is rewritten.  The parent version remains at the snapshot version in the rewritten pom.
> This happens in dry run mode and normal mode.
> I will attach a zip file with a simple example/test case that shows the bug.  The steps to reproduce using the zip file:
> 1. cd to parent
> 2. execute "mvn install"
> 3. cd to ../child
> 4. execute "mvn -DdryRun=true release:prepare" answering "yes" to the first
>    "resolve dependencies?" question and then answering with the default to
>    all the other questions
> 5. cat pom.xml.tag noticing the parent SNAPSHOT version has not been replaced
> The cause of this appears to be in AbstractRewritePomsPhase.rewriteParent.  This method only consults the mappedVersions Map, however when the release plugin is executed from the command line and the user enters the version number to resolve the snapshot dependency (even using the default provided by the release plugin) the values are stored in the resolvedSnapshotDependencies Map only.
> I've modified the code to consult both Maps which is what other methods in the class do when rewriting dependency snapshot revisions.  I have provided a patch with the modified code.  The patch also contains a new test method in RewritePomsForReleasePhaseTest that will fail without the patch and pass with it.
> The patch was taken from maven-release 2.0-beta-9 and can be applied with
> {code}
> patch -p0 < ~/maven-release-rewrite-parent-bug.patch
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MRELEASE-449) Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRELEASE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=204972#action_204972 ] 

Dennis Lundberg commented on MRELEASE-449:
------------------------------------------

I can confirm that the sample project fails in the way that is described in this issue.

What I can't understand is, how doing a release in this way could work outside a dry run. You can't release a parent from a child can you?

Also parent 1.0 must be deployed prior to child 1.1 (specifying parent-1.0 as parent) being released.

> Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare
> ------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-449
>                 URL: http://jira.codehaus.org/browse/MRELEASE-449
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0-beta-9
>            Reporter: Steve Gilbert
>            Priority: Critical
>             Fix For: 2.0-beta-10
>
>         Attachments: maven-release-rewrite-parent-bug.patch, parent_version_rewrite_bug.zip
>
>
> When a pom has a parent specified with a snapshot version, when "mvn release:prepare" is executed, the version entered by the user when prompted to resolve the parent version is not used when the pom is rewritten.  The parent version remains at the snapshot version in the rewritten pom.
> This happens in dry run mode and normal mode.
> I will attach a zip file with a simple example/test case that shows the bug.  The steps to reproduce using the zip file:
> 1. cd to parent
> 2. execute "mvn install"
> 3. cd to ../child
> 4. execute "mvn -DdryRun=true release:prepare" answering "yes" to the first
>    "resolve dependencies?" question and then answering with the default to
>    all the other questions
> 5. cat pom.xml.tag noticing the parent SNAPSHOT version has not been replaced
> The cause of this appears to be in AbstractRewritePomsPhase.rewriteParent.  This method only consults the mappedVersions Map, however when the release plugin is executed from the command line and the user enters the version number to resolve the snapshot dependency (even using the default provided by the release plugin) the values are stored in the resolvedSnapshotDependencies Map only.
> I've modified the code to consult both Maps which is what other methods in the class do when rewriting dependency snapshot revisions.  I have provided a patch with the modified code.  The patch also contains a new test method in RewritePomsForReleasePhaseTest that will fail without the patch and pass with it.
> The patch was taken from maven-release 2.0-beta-9 and can be applied with
> {code}
> patch -p0 < ~/maven-release-rewrite-parent-bug.patch
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MRELEASE-449) Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare

Posted by "Robert Scholte (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MRELEASE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte closed MRELEASE-449.
-----------------------------------

    Resolution: Duplicate
      Assignee: Robert Scholte

Looking to the patch it seems that this has already been fixed as part of MRELEASE-317, so closing it as {{duplicate}}.
                
> Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare
> ------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-449
>                 URL: https://jira.codehaus.org/browse/MRELEASE-449
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0-beta-9
>            Reporter: Steve Gilbert
>            Assignee: Robert Scholte
>            Priority: Critical
>         Attachments: maven-release-rewrite-parent-bug.patch, MRELEASE-449.diff, parent_version_rewrite_bug.zip
>
>
> When a pom has a parent specified with a snapshot version, when "mvn release:prepare" is executed, the version entered by the user when prompted to resolve the parent version is not used when the pom is rewritten.  The parent version remains at the snapshot version in the rewritten pom.
> This happens in dry run mode and normal mode.
> I will attach a zip file with a simple example/test case that shows the bug.  The steps to reproduce using the zip file:
> 1. cd to parent
> 2. execute "mvn install"
> 3. cd to ../child
> 4. execute "mvn -DdryRun=true release:prepare" answering "yes" to the first
>    "resolve dependencies?" question and then answering with the default to
>    all the other questions
> 5. cat pom.xml.tag noticing the parent SNAPSHOT version has not been replaced
> The cause of this appears to be in AbstractRewritePomsPhase.rewriteParent.  This method only consults the mappedVersions Map, however when the release plugin is executed from the command line and the user enters the version number to resolve the snapshot dependency (even using the default provided by the release plugin) the values are stored in the resolvedSnapshotDependencies Map only.
> I've modified the code to consult both Maps which is what other methods in the class do when rewriting dependency snapshot revisions.  I have provided a patch with the modified code.  The patch also contains a new test method in RewritePomsForReleasePhaseTest that will fail without the patch and pass with it.
> The patch was taken from maven-release 2.0-beta-9 and can be applied with
> {code}
> patch -p0 < ~/maven-release-rewrite-parent-bug.patch
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MRELEASE-449) Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRELEASE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Lamy updated MRELEASE-449:
----------------------------------

    Fix Version/s: 2.0-beta-10

> Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare
> ------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-449
>                 URL: http://jira.codehaus.org/browse/MRELEASE-449
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0-beta-9
>            Reporter: Steve Gilbert
>            Priority: Critical
>             Fix For: 2.0-beta-10
>
>         Attachments: maven-release-rewrite-parent-bug.patch, parent_version_rewrite_bug.zip
>
>
> When a pom has a parent specified with a snapshot version, when "mvn release:prepare" is executed, the version entered by the user when prompted to resolve the parent version is not used when the pom is rewritten.  The parent version remains at the snapshot version in the rewritten pom.
> This happens in dry run mode and normal mode.
> I will attach a zip file with a simple example/test case that shows the bug.  The steps to reproduce using the zip file:
> 1. cd to parent
> 2. execute "mvn install"
> 3. cd to ../child
> 4. execute "mvn -DdryRun=true release:prepare" answering "yes" to the first
>    "resolve dependencies?" question and then answering with the default to
>    all the other questions
> 5. cat pom.xml.tag noticing the parent SNAPSHOT version has not been replaced
> The cause of this appears to be in AbstractRewritePomsPhase.rewriteParent.  This method only consults the mappedVersions Map, however when the release plugin is executed from the command line and the user enters the version number to resolve the snapshot dependency (even using the default provided by the release plugin) the values are stored in the resolvedSnapshotDependencies Map only.
> I've modified the code to consult both Maps which is what other methods in the class do when rewriting dependency snapshot revisions.  I have provided a patch with the modified code.  The patch also contains a new test method in RewritePomsForReleasePhaseTest that will fail without the patch and pass with it.
> The patch was taken from maven-release 2.0-beta-9 and can be applied with
> {code}
> patch -p0 < ~/maven-release-rewrite-parent-bug.patch
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MRELEASE-449) Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare

Posted by "Gabriel Falkenberg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRELEASE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=214005#action_214005 ] 

Gabriel Falkenberg edited comment on MRELEASE-449 at 3/16/10 5:21 AM:
----------------------------------------------------------------------

I can confirm that the patch fixes the problem and have updated the patch to apply cleanly on trunk (revision 923664). 

Are there any plans to include this in a release?

      was (Author: gabriel.falkenberg@gmail.com):
    Updated the patch to apply cleanly on trunk (revision 923664).
  
> Parent snapshot version is not rewritten to resolved non-snapshot version during release:prepare
> ------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-449
>                 URL: http://jira.codehaus.org/browse/MRELEASE-449
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0-beta-9
>            Reporter: Steve Gilbert
>            Priority: Critical
>         Attachments: maven-release-rewrite-parent-bug.patch, MRELEASE-449.diff, parent_version_rewrite_bug.zip
>
>
> When a pom has a parent specified with a snapshot version, when "mvn release:prepare" is executed, the version entered by the user when prompted to resolve the parent version is not used when the pom is rewritten.  The parent version remains at the snapshot version in the rewritten pom.
> This happens in dry run mode and normal mode.
> I will attach a zip file with a simple example/test case that shows the bug.  The steps to reproduce using the zip file:
> 1. cd to parent
> 2. execute "mvn install"
> 3. cd to ../child
> 4. execute "mvn -DdryRun=true release:prepare" answering "yes" to the first
>    "resolve dependencies?" question and then answering with the default to
>    all the other questions
> 5. cat pom.xml.tag noticing the parent SNAPSHOT version has not been replaced
> The cause of this appears to be in AbstractRewritePomsPhase.rewriteParent.  This method only consults the mappedVersions Map, however when the release plugin is executed from the command line and the user enters the version number to resolve the snapshot dependency (even using the default provided by the release plugin) the values are stored in the resolvedSnapshotDependencies Map only.
> I've modified the code to consult both Maps which is what other methods in the class do when rewriting dependency snapshot revisions.  I have provided a patch with the modified code.  The patch also contains a new test method in RewritePomsForReleasePhaseTest that will fail without the patch and pass with it.
> The patch was taken from maven-release 2.0-beta-9 and can be applied with
> {code}
> patch -p0 < ~/maven-release-rewrite-parent-bug.patch
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira