Bernhard Mähr created MRELEASE-840:
--------------------------------------

             Summary: Merge SNAPSHOT Parents to avoid unnecessary aborts
                 Key: MRELEASE-840
                 URL: https://jira.codehaus.org/browse/MRELEASE-840
             Project: Maven 2.x Release Plugin
          Issue Type: Improvement
            Reporter: Bernhard Mähr


Handling of the version numbers in bigger projects with Maven is still a big 
pain.

I have a suggestion to improve the situation dramatically: The release plugin 
should be able to merge SNAPSHOT-parent POMs into the POM just released.

I have implemented that with a batch job. The algorithm is:
call mvn help:effective-pom -B -Doutput=./pom.xml.effective -N
ren pom.xml pom.xml.original
ren pom.xml.effective pom.xml
sed -n -r -i 
"1h;1!H;${;g;s/<dependencyManagement>.*<\/dependencyManagement>//g;p;}" pom.xml
sed -n -r -i "1h;1!H;${;g;s/<parent>.*<\/parent>//g;p;}" pom.xml
sed -n -r -i "1h;1!H;${;g;s/<extensions>.*<\/extensions>//g;p;}" pom.xml
call mvn release:prepare -B 
-DcheckModificationExcludeList=pom.xml,pom.xml.original
grep "project.dev." release.properties > setversion.bat
sed -n -r -i 
"1h;1!H;${;g;s/project\.dev\.[A-Za-z\.\-]+\\:[A-Za-z\.\-]+=([0-9\.]+\-SNAPSHOT)/call
 mvn versions:set \-DgenerateBackupPoms=false \-DnewVersion=\1/g;p;}" 
setversion.bat
call mvn release:perform -B
del pom.xml
ren pom.xml.original pom.xml 
call setversion.bat
del setversion.bat
svn commit -m "Restore development version by mvnrelease" pom.xml

Basically the pom ist replaced by the effective pom, SNAPSHOT-dependecies not 
used by release are removed to avoid abort, release is performd and the old pom 
is restored with the new version number





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

Reply via email to