Maven 1.x Release Plugin

Sometimes the scm:prepare-release goal would commit blank project.xml into cvs

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    - Windows 2000
    - Maven RC3
    - CVS client (version 1.12.7 - downloaded from http://www.cvshome.org/dev/codewindow.html)
  • Number of attachments :
    0

Description

Problem:

The problem is that sometimes the scm:prepare-release goal would commit blank project.xml into cvs.

Suggested Cause:

This looks like its due to the fact that the line <r:release-version version="${version_name}" tag="${tag_name}" /> has not finished updating the project.xml, before the project.xml is committed to cvs in the next line. However, our team has not come across any half-completed project.xml just blank or perfectly updated ones.

Suggested Solution:

Add a "sleep" goal inbetween the r:release line and the cvs commit line in the scm:prepare-release goal.

Extra Information:

Here is a maven.xml extract that I hope will you will be able to use to demonstrate the bug and the solution. You should notice in the CVS history of the project.xml you choose to test with that some versions of the checked-in project.xml was blank when running the test goal without the sleep inbetween.

<goal name="release:test-fault"
prereqs="scm:validate">
<echo>Release Test - fault</echo>

<j:forEach begin="0" end="10" indexVar="index">
<j:set var="incrementedVersion" value="${index}-test-SNAPSHOT"/>
<r:release-version version="${incrementedVersion}" tag="Not Tagged"/>
<ant:cvs command="commit -m '[release:test-faulty] testing the release - no: ${index}' -f project.xml"
quiet="${pom.getPluginContext('maven-scm-plugin').getVariable('maven.scm.cvs.quiet')}"
cvsRsh="${pom.getPluginContext('maven-scm-plugin').getVariable('maven.scm.cvs.rsh')}"
cvsRoot="${pom.getPluginContext('maven-scm-plugin').getVariable('maven.scm.cvs.root')}"
failonerror="true"/>
</j:forEach>
</goal>

<goal name="release:test-fix"
prereqs="scm:validate">
<echo>Release Test - fix</echo>

<j:forEach begin="0" end="10" indexVar="index">
<j:set var="incrementedVersion" value="${index}-test-SNAPSHOT"/>
<r:release-version version="${incrementedVersion}" tag="Not Tagged"/>
<echo>Sleeping for 5 secs to allow the Project.xml to be updated</echo>
<ant:sleep seconds="5"/>
<echo>Now doing the commit</echo>
<ant:cvs command="commit -m '[release:test-fix] testing the release - no: ${index}' -f project.xml"
quiet="${pom.getPluginContext('maven-scm-plugin').getVariable('maven.scm.cvs.quiet')}"
cvsRsh="${pom.getPluginContext('maven-scm-plugin').getVariable('maven.scm.cvs.rsh')}"
cvsRoot="${pom.getPluginContext('maven-scm-plugin').getVariable('maven.scm.cvs.root')}"
failonerror="true"/>
</j:forEach>
</goal>

Issue Links

Activity

Hide
Paul Spencer added a comment -

This sounds very simular to MPSCM-24. I checked and I noticed the output file is not closed, or flushed, in the release plugin.

Show
Paul Spencer added a comment - This sounds very simular to MPSCM-24. I checked and I noticed the output file is not closed, or flushed, in the release plugin.
Hide
Carlos Sanchez added a comment -

Should be fixed with version 1.6 of the changes plugin

Show
Carlos Sanchez added a comment - Should be fixed with version 1.6 of the changes plugin
Hide
Paul Spencer added a comment -

Unless the plugin has been changed to use the CHANGES plugin, it is not a duplicate. I believe this plugin uses the RELEASE plugin.

Show
Paul Spencer added a comment - Unless the plugin has been changed to use the CHANGES plugin, it is not a duplicate. I believe this plugin uses the RELEASE plugin.
Hide
Carlos Sanchez added a comment -

Fixed in version 1.5-SNAPSHOT of the release plugin

Show
Carlos Sanchez added a comment - Fixed in version 1.5-SNAPSHOT of the release plugin

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
1d
Original Estimate - 1 day
Remaining:
1d
Remaining Estimate - 1 day
Logged:
Not Specified
Time Spent - Not Specified