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

Darryl L. Miles updated MRELEASE-808:
-------------------------------------

    Attachment: 0001-MRELEASE-808-Allow-fixup-of-SNAPSHOT-version-in-fina.patch

UPDATED PATCH

This replaces the existing patch.

Patch against GIT tree maven-release.git trunk 55dcd08

This add checking/protection from other use since the previous version pf the 
patch, this version protects against cases where projectVersion="1" and 
releaseVersion="2" this is why it was considered unsafe before.

The most ideal patch would be to have the newly constructed MavenProject model 
in memory go back to the original ${variable} and reinterpret the variable in 
the context of the new in-memory model and then set the finalName field to the 
new value.

But for now this patch fixes the problem for me and should provide protection 
against editing the value incorrectly in other cases.
                
> prepare-with-pom needs to be run twice when <finalName> contains 
> ${project.version}
> -----------------------------------------------------------------------------------
>
>                 Key: MRELEASE-808
>                 URL: https://jira.codehaus.org/browse/MRELEASE-808
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>            Reporter: Darryl L. Miles
>         Attachments: 
> 0001-MRELEASE-808-Allow-fixup-of-SNAPSHOT-version-in-fina.patch, 
> 0001-MRELEASE-808-Allow-fixup-of-SNAPSHOT-version-in-fina.patch
>
>
> Setup your project with a <project><build><finalName> element setup like:
> <finalName>${project.groupId}.${project.artifactId}-${project.version}</finalName>
> Setup ${project.version} to a SNAPSHOT like:
> <version>0.0.1-SNAPSHOT</version>
> The key thing here is the use of ${project.version} in the <finalName> and ew 
> start with a SNAPSHOT version trying to perform a release.
> Now we run: mvn release:prepare-with-pom
> It will bail out with error now and a message ... "Cannot reliably adjust the 
> finalName of project:" and I believe this is due to the -SNAPSHOT being 
> visible and the code that throw the exception is looking at the original, 
> unedited version of the pom.xml.
> I think after editing the pom.xml the in-memory model should be refreshed and 
> all ${variable} be re-interpreted.

--
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

        

Reply via email to