Issue Details (XML | Word | Printable)

Key: MPRELEASE-9
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Carlos Sanchez
Reporter: Dulon Zaman
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Maven 1.x Release Plugin

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

Created: 16/Jun/04 11:07 AM   Updated: 06/Aug/04 06:50 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Original Estimate: 1 day
Original Estimate - 1 day
Remaining Estimate: 1 day
Remaining Estimate - 1 day
Time Spent: Not Specified
Remaining Estimate - 1 day

Environment:
- Windows 2000
- Maven RC3
- CVS client (version 1.12.7 - downloaded from http://www.cvshome.org/dev/codewindow.html)
Issue Links:
Related
 


 Description  « Hide
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>



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Paul Spencer added a comment - 06/Aug/04 04:43 PM
This sounds very simular to MPSCM-24. I checked and I noticed the output file is not closed, or flushed, in the release plugin.

Carlos Sanchez added a comment - 06/Aug/04 05:50 PM
Should be fixed with version 1.6 of the changes plugin

Paul Spencer added a comment - 06/Aug/04 06:06 PM
Unless the plugin has been changed to use the CHANGES plugin, it is not a duplicate. I believe this plugin uses the RELEASE plugin.


Carlos Sanchez added a comment - 06/Aug/04 06:50 PM
Fixed in version 1.5-SNAPSHOT of the release plugin