You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Mark Gibson (JIRA)" <ji...@codehaus.org> on 2014/08/29 13:46:10 UTC

[jira] (MRELEASE-694) -SNAPSHOT is unexpectedly appended to version in branched pom.xml

    [ https://jira.codehaus.org/browse/MRELEASE-694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=352010#comment-352010 ] 

Mark  Gibson commented on MRELEASE-694:
---------------------------------------

I am still seeing this issue in 2.5.

I have a file structure like:
{code}
|   pom.xml
|
\---java
    +---child1
    |   |   pom.xml
    |
    +---child2
        |   pom.xml
{code}

and a command line:

{code}
--batch-mode release:branch \
    -DbranchName=RELEASE-2.6.0 \
    -DdevelopmentVersion=2.6.1-DEV-SNAPSHOT \
    -DreleaseVersion=2.6.0 \
    -DupdateVersionsToSnapshot=false 
{code}
    
with the following in the POM

{code:xml}
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <updateBranchVersions>true</updateBranchVersions>
          <updateWorkingCopyVersions>true</updateWorkingCopyVersions>
          <updateDependencies>true</updateDependencies>
          <pushChanges>true</pushChanges>
          <remoteTagging>false</remoteTagging>
          <suppressCommitBeforeBranch>false</suppressCommitBeforeBranch>
        </configuration>
      </plugin>
{code}

The issue seems to be caused by the MapVersionsPhase.  Not matter what I try, it decides to map all the release versions to 2.6.1-SNAPSHOT ... That is, it takes the version from the developement spec (excluding other bits) and then appends "-SNAPSHOT".

I've tried adding specific project version overrides.  i.e.

{code}
--batch-mode release:branch \
    -DbranchName=RELEASE-2.6.0 \
    -DdevelopmentVersion=2.6.1-DEV-SNAPSHOT \
    -DreleaseVersion=2.6.0 \
    -DupdateVersionsToSnapshot=false \
    -DautoVersionSubmodules=false \
    -Dproject.rel.[groupId]:parent-pom=2.6.0 \
    -Dproject.rel.[groupId]:child1=2.6.0 \
    -Dproject.rel.[groupId]:child2=2.6.0
{code}

(I also removed the <autoVersionSubmodules> tag from the parent pom for this test).

These manual overrides just get replaced during the MapVersionsPhase (map-branch-versions).  I added some logging to the 2.5 code locally.  I've included below a snippet of the output which shows the state of the ReleaseDescriptor either side of the MapVersionsPhase.execute call where I've tried to manually force the versions ...

{code}
[INFO] Gibbo: DefaultReleaseManager.branch(): branch phase: map-branch-versions (class org.apache.maven.shared.release.phase.MapVersionsPhase$__sisu2)
[INFO] Gibbo: ReleaseDescriptor prior to phase execute: AdditionaArguments: -P artifactory
CheckoutDirectory: null
CheckModificationExcludes: []
CompletedPhase: null
CompletionGoals: null
DefaultDevelopmentVersion: 2.6.15-DEV-SNAPSHOT
DefaultReleaseVersion: 2.6.14
OriginalScmInfo: {}
DevelopementVersions: {}
ReleaseVersions: {com.deltaone.sola.sync:sola-sync-pom=2.6.14, com.deltaone.sola.sync:sola-sync-clientdb=2.6.14, com.deltaone.sola.sync:sola-sync-proto=2.6.14, com.deltaone.sola.sync:sola-sync-ddm=2.6.14, com.deltaone.sola.sync:sola-sync-utils=2.6.14, com.deltaone.sola.sync:sola-sync-ddm-linux=2.6.14}
ResolvedSnapshotDependencies: {}
Description: null
ModelEncoding: UTF-8
Name: null
PerformGoals: null
PomFileName: null
PreparationGoals: null
ScmBranchBase: null
ScmCommentPrefix: [maven-release-plugin] 
ScmId: null
ScmPassword: null
ScmPrivateKey: null
ScmPrivateKeyPassPhrase: null
ScmRelativePathProjectDirectory: null
ScmReleasedPomVersion: null
ScmReleaseLabel: RELEASE-2.6.14
ScmSourceUrl: scm:git:redacted
ScmTagBase: null
ScmTagNameFormat: @{project.artifactId}-@{project.version}
ScmUsername: null
WaitBeforeTagging: 0
WorkingDirectory: /home/jenkins/jobs/SolaSync-2.6-CreateReleaseBranch/workspace
IsAddSchema: true
IsAllowTimestampedSnapshots: false
IsAutoVersionSubmodules: false
IsBranchCreation: true
IsCommitByProject: false
IsGenerateReleasePoms: false
IsInteractive: false
IsLocalCheckout: false
IsPushChanges: true
IsRemoteTagging: false
IsScmUseEditMode: false
IsSnapshotReleasePluginAllowed: false
IsSuppressCommitBeforeTagOrBranch: false
IsUpdateBranchVersions: true
IsUpdateDependencies: true
IsUpdateVersionsToSnapshots: false
IsUpdateWorkingCopyVersions: true
IsUseReleaseProfile: true

[INFO] Gibbo: MapVersionsPhase.execute(): convertToSnapshot=true, convertToBranch=true
[INFO] Gibbo: ReleaseDescriptor post phase execute: AdditionaArguments: -P artifactory
CheckoutDirectory: null
CheckModificationExcludes: []
CompletedPhase: null
CompletionGoals: null
DefaultDevelopmentVersion: 2.6.15-DEV-SNAPSHOT
DefaultReleaseVersion: 2.6.14
OriginalScmInfo: {}
DevelopementVersions: {}
ReleaseVersions: {com.deltaone.sola.sync:sola-sync-pom=2.6.15-SNAPSHOT, com.deltaone.sola.sync:sola-sync-clientdb=2.6.15-SNAPSHOT, com.deltaone.sola.sync:sola-sync-proto=2.6.15-SNAPSHOT, com.deltaone.sola.sync:sola-sync-ddm=2.6.15-SNAPSHOT, com.deltaone.sola.sync:sola-sync-utils=2.6.15-SNAPSHOT, com.deltaone.sola.sync:sola-sync-ddm-linux=2.6.15-SNAPSHOT}
ResolvedSnapshotDependencies: {}
Description: null
ModelEncoding: UTF-8
Name: null
PerformGoals: null
PomFileName: null
PreparationGoals: null
ScmBranchBase: null
ScmCommentPrefix: [maven-release-plugin] 
ScmId: null
ScmPassword: null
ScmPrivateKey: null
ScmPrivateKeyPassPhrase: null
ScmRelativePathProjectDirectory: null
ScmReleasedPomVersion: null
ScmReleaseLabel: RELEASE-2.6.14
ScmSourceUrl: scm:git:redacted
ScmTagBase: null
ScmTagNameFormat: @{project.artifactId}-@{project.version}
ScmUsername: null
WaitBeforeTagging: 0
WorkingDirectory: /home/jenkins/jobs/SolaSync-2.6-CreateReleaseBranch/workspace
IsAddSchema: true
IsAllowTimestampedSnapshots: false
IsAutoVersionSubmodules: false
IsBranchCreation: true
IsCommitByProject: false
IsGenerateReleasePoms: false
IsInteractive: false
IsLocalCheckout: false
IsPushChanges: true
IsRemoteTagging: false
IsScmUseEditMode: false
IsSnapshotReleasePluginAllowed: false
IsSuppressCommitBeforeTagOrBranch: false
IsUpdateBranchVersions: true
IsUpdateDependencies: true
IsUpdateVersionsToSnapshots: false
IsUpdateWorkingCopyVersions: true
IsUseReleaseProfile: true
{code}



> -SNAPSHOT is unexpectedly appended to version in branched pom.xml
> -----------------------------------------------------------------
>
>                 Key: MRELEASE-694
>                 URL: https://jira.codehaus.org/browse/MRELEASE-694
>             Project: Maven Release Plugin
>          Issue Type: Bug
>          Components: branch
>    Affects Versions: 2.1, 2.2
>         Environment: apache-maven-2.2.1
>            Reporter: Ken Alexandersson
>            Priority: Critical
>         Attachments: pom.xml.branch, pom.xml.next, pom.xml.releaseBackup
>
>
> When running the following
> {{mvn org.apache.maven.plugins:maven-release-plugin:2.2:branch -DbranchName=ROOT_1.0_RB -DupdateBranchVersions=true -DautoVersionSubmodules=true -DdryRun=true -DreleaseVersion=1.0 -DdevelopmentVersion=1.1-SNAPSHOT}}
> the branched pom.xml gets the version "1.0-SNAPSHOT" instead of expected "1.0" (please see attached poms for details). Trying to add {{-DupdateVersionsToSnapshot=false}} does not help either. 
> Side note: Did a run in interactive mode (by leaving out {{-DreleaseVersion=1.0}} and {{-DdevelopmentVersion=1.1-SNAPSHOT}}, which produced an expected result where the submitted versions were reflected correctly in the pom-files.  



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)