release-descriptor
ReleaseDescriptor
A release descriptor contains everything that is needed to perform a
release. A release descriptor can be used by third party systems like
Continuum to perform releases in a consistent way. The release model could also
be deployed to the repository manager so that new releases can be announced easily
and automatically.
package
org.apache.maven.shared.release.config
ReleaseDescriptor
1.0.0+
name
1.0.0+
String
The name of this release configuration
description
1.0.0+
String
The description of this release configuration
ScmCommentPrefix
1.0.0+
String
[maven-release-manager]
The prefix of SCM modification messages
scmSourceUrl
1.0.0+
String
This is a MavenSCM of where you're going to get the sources to make the release with.
Example: scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-release-plugin
scmTagBase
1.0.0+
String
Where you are going to put your tagged sources
Example https://svn.apache.org/repos/asf/maven/plugins/tags
scmBranchBase
1.0.0+
String
Where you are going to put your branched sources
Example https://svn.apache.org/repos/asf/maven/plugins/branches
scmReleaseLabel
1.0.0+
String
tag or branch name: the identifier for the tag/branch.
Example: maven-release-plugin-2.0
scmId
2.3.0+
String
The id can be used to get the credentials by the server-id from the settings.xml
scmUsername
1.0.0+
String
The user name to interact with the scm
scmPassword
1.0.0+
String
The password for the user interacting with the scm
scmPrivateKey
1.0.0+
String
Private key for an SSH based SCM repository.
scmPrivateKeyPassPhrase
1.0.0+
String
Pass phrase for the private key.
scmUseEditMode
1.0.0+
boolean
Whether to use edit mode when making SCM modifications. This setting is disregarded
if the SCM does not support edit mode, or if edit mode is compulsory for the given SCM.
scmRelativePathProjectDirectory
1.0.0+
String
Relative path of the project returned by the checkout command.
releaseVersions
1.0.0+
Map
String
*
A map of projects to versions to use when releasing the given projects.
developmentVersions
1.0.0+
Map
String
*
A map of projects to versions to use when moving the given projects back into development after release.
resolvedSnapshotDependencies
1.0.0+
Map
String
*
A map of resolved snapshot dependencies versions.
updateDependencies
1.0.0+
boolean
true
If updateDependencies is false, dependencies version won't be updated to the next development version.
useReleaseProfile
1.0.0+
boolean
true
Whether to use the release profile that adds sources and javadocs to the released artifact, if appropriate.
If set to true, this will set the property "performRelease" to true.
originalScmInfo
1.0.0+
Map
String
*
A map of projects to original SCM information.
workingDirectory
1.0.0+
String
The directory where the release is performed.
checkoutDirectory
1.0.0+
String
The directory where the tag will be checked out.
completedPhase
1.0.0+
String
The last completed phase.
addSchema
1.0.0+
boolean
false then the root element will remain untouched.]]>
generateReleasePoms
1.0.0+
boolean
Whether to generate release POMs.
autoVersionSubmodules
1.0.0+
boolean
Whether to use the parent pom version for submodule versions.
interactive
1.0.0+
boolean
true
Whether the release process is interactive and the release manager should be prompted to
confirm values, or whether the defaults are used regardless.
snapshotReleasePluginAllowed
1.0.0+
boolean
false
Whether a SNAPSHOT of the release plugin is allowed.
additionalArguments
1.0.0+
String
Additional arguments to pass to any executed Maven process.
pomFileName
1.0.0+
String
The file name of the POM to pass to any executed Maven process.
checkModificationExcludes
2.1.0+
List
String
*
In some exceptions you want to allow changes to the working copy. Changes
to files listed here will not make the ScmCheckModificationsPhase fail.
preparationGoals
1.0.0+
String
The goals to execute in preparation for the release.
completionGoals
2.2.0+
String
The goals to execute in on completion of preparation for the release.
performGoals
1.0.0+
String
The goals to execute in perform phase for the release.
commitByProject
1.0.0+
boolean
false
The commits must be done by modules or not. Set it to true in case of flat directory structure.
branchCreation
1.0.0+
boolean
Whether to create a branch instead of do a release.
updateBranchVersions
1.0.0+
boolean
Whether to update branch POM versions.
updateWorkingCopyVersions
1.0.0+
boolean
true
Whether to update working copy POM versions.
updateVersionsToSnapshot
1.0.0+
boolean
Whether to update branch versions to SNAPSHOT.
suppressCommitBeforeTagOrBranch
2.1.0+
boolean
Whether to suppress a commit of changes to the working copy before a tag or branch is created.
waitBeforeTagging
2.2.0+
int
Wait the specified number of seconds before creating a tag.
allowTimestampedSnapshots
1.0.0+
boolean
false
Should timestamped SNAPSHOT dependencies be allowed? Default is to fail when any SNAPSHOT
dependency is found.
defaultReleaseVersion
1.0.0+
String
Default version to use for the tagged release or the new branch.
defaultDevelopmentVersion
1.0.0+
String
Default version to use for new working copy.
projectVersionPolicyId
2.5.1+
String
default
The role-hint for the VersionPolicy implementation used to calculate the project versions.
projectNamingPolicyId
3.0.0+
String
The role-hint for the NamingPolicy implementation used to calculate the project branch and tag names.
remoteTagging
1.0.0+
boolean
false
NOTE : currently only implemented with svn scm. Enable a workaround to prevent issue due to svn client > 1.5.0
(http://jira.codehaus.org/browse/SCM-406)
scmReleasedPomRevision
1.0.0+
String
NOTE : currently only implemented with svn scm. It contains the revision of the committed released pom to remotely tag
the source code with this revision.
pushChanges
2.0.0+
boolean
true
Should distributed changes be pushed to the central repository?
For many distributed SCMs like Git, a change like a commit is only stored in your local copy of the repository.
Pushing the change allows your to more easily share it with other users.
localCheckout
2.0.0+
boolean
false
If the scm provider should use local checkouts via file://${basedir}
instead of doing a clean checkout over the network.
This is very helpful for releasing large projects!
scmTagNameFormat
2.2.0+
String
Specifies the format for generating a tag name. Property expansion is
used with the optional prefix of project, where properties are delimited
with @{ and }
2.1.0+
getOriginalVersions( java.util.List reactorProjects )
{
if ( originalVersions == null )
{
originalVersions = new java.util.HashMap();
for ( org.apache.maven.project.MavenProject project : reactorProjects )
{
originalVersions.put( org.apache.maven.artifact.ArtifactUtils.versionlessKey( project.getGroupId(),
project.getArtifactId() ), project.getVersion() );
}
}
return originalVersions;
}
/**
* Retrieve the release version for the resolved snapshot dependency.
*
*/
public String getDependencyDevelopmentVersion( String artifactConflictId )
{
if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
{
java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
return ( String ) versionMap.get( DEVELOPMENT_KEY );
}
return null;
}
/**
* Retrieve the release version for the resolved snapshot dependency.
*
*/
public String getDependencyReleaseVersion( String artifactConflictId )
{
if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
{
java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
return ( String ) versionMap.get( RELEASE_KEY );
}
return null;
}
boolean safeEquals( String a, String b )
{
return a != null ? a.equals( b ) : b == null;
}
public boolean equals( Object obj )
{
if ( this == obj )
{
return true;
}
if ( obj == null || getClass() != obj.getClass() )
{
return false;
}
ReleaseDescriptor that = (ReleaseDescriptor) obj;
if ( updateDependencies != that.updateDependencies ||
useReleaseProfile != that.useReleaseProfile ||
autoVersionSubmodules != that.autoVersionSubmodules ||
snapshotReleasePluginAllowed != that.snapshotReleasePluginAllowed ||
commitByProject != that.commitByProject ||
branchCreation != that.branchCreation ||
updateBranchVersions != that.updateBranchVersions ||
updateWorkingCopyVersions != that.updateWorkingCopyVersions||
suppressCommitBeforeTagOrBranch != that.suppressCommitBeforeTagOrBranch ||
updateVersionsToSnapshot != that.updateVersionsToSnapshot ||
allowTimestampedSnapshots != that.allowTimestampedSnapshots||
remoteTagging != that.remoteTagging ||
localCheckout != that.localCheckout ||
pushChanges != that.pushChanges
)
{
return false;
}
if ( !safeEquals( defaultDevelopmentVersion, that.defaultDevelopmentVersion ) ||
!safeEquals( scmRelativePathProjectDirectory, that.scmRelativePathProjectDirectory ) ||
!safeEquals( checkoutDirectory, that.checkoutDirectory ) ||
!safeEquals( performGoals, that.performGoals ) ||
!safeEquals( defaultReleaseVersion, that.defaultReleaseVersion ) ||
!safeEquals( scmReleasedPomRevision, that.scmReleasedPomRevision )
)
{
return false;
}
if ( addSchema != that.addSchema )
{
return false;
}
if ( generateReleasePoms != that.generateReleasePoms )
{
return false;
}
if ( interactive != that.interactive )
{
return false;
}
if ( scmUseEditMode != that.scmUseEditMode )
{
return false;
}
if ( !safeEquals( completedPhase, that.completedPhase ) )
{
return false;
}
if ( ( checkModificationExcludes == null || ( checkModificationExcludes != null && checkModificationExcludes.size() == 0) ) &&
( that.checkModificationExcludes == null || ( that.checkModificationExcludes != null && that.checkModificationExcludes.size() == 0) ) )
{
// Do nothing. This is a Modello workaround
}
else
{
if ( checkModificationExcludes != null ? !checkModificationExcludes.equals( that.checkModificationExcludes )
: that.checkModificationExcludes != null )
{
return false;
}
}
if ( ( developmentVersions == null || ( developmentVersions != null && developmentVersions.size() == 0) ) &&
( that.developmentVersions == null || ( that.developmentVersions != null && that.developmentVersions.size() == 0) ) )
{
// Do nothing. This is a Modello workaround
}
else
{
if ( developmentVersions != null ? !developmentVersions.equals( that.developmentVersions )
: that.developmentVersions != null )
{
return false;
}
}
if ( ( originalScmInfo == null || (originalScmInfo != null && originalScmInfo.size() == 0 ) ) &&
( that.originalScmInfo == null || ( that.originalScmInfo != null && that.originalScmInfo.size() == 0 ) ) )
{
// Do nothing. This is a Modello workaround
}
else
{
if ( originalScmInfo != null ? !compareScmCollections( that.originalScmInfo ) : that.originalScmInfo != null )
{
return false;
}
}
if ( ( releaseVersions == null || ( releaseVersions != null && releaseVersions.size() == 0 ) ) &&
( that.releaseVersions == null || ( that.releaseVersions != null && that.releaseVersions.size() == 0 ) ) )
{
// Do nothing. This is a Modello workaround
}
else
{
if ( releaseVersions != null ? !releaseVersions.equals( that.releaseVersions ) : that.releaseVersions != null )
{
return false;
}
}
if ( !safeEquals( additionalArguments, that.additionalArguments ) )
{
return false;
}
if ( !safeEquals( preparationGoals, that.preparationGoals ) )
{
return false;
}
if ( !safeEquals( completionGoals, that.completionGoals ) )
{
return false;
}
if ( !safeEquals( pomFileName, that.pomFileName ) )
{
return false;
}
if ( !safeEquals( scmPrivateKeyPassPhrase, that.scmPrivateKeyPassPhrase ) )
{
return false;
}
if ( !safeEquals( scmPassword, that.scmPassword ) )
{
return false;
}
if ( !safeEquals( scmPrivateKey, that.scmPrivateKey ) )
{
return false;
}
if ( !safeEquals( scmReleaseLabel, that.scmReleaseLabel ) )
{
return false;
}
if ( !safeEquals( scmTagBase, that.scmTagBase ) )
{
return false;
}
if ( !safeEquals( scmBranchBase, that.scmBranchBase ) )
{
return false;
}
if ( !safeEquals( scmId, that.scmId ) )
{
return false;
}
if ( !safeEquals( scmSourceUrl, that.scmSourceUrl ) )
{
return false;
}
if ( !safeEquals( scmUsername, that.scmUsername ) )
{
return false;
}
if ( !safeEquals( workingDirectory, that.workingDirectory ) )
{
return false;
}
if ( !safeEquals( scmTagNameFormat, that.scmTagNameFormat ) )
{
return false;
}
return true;
}
private boolean compareScmCollections( java.util.Map that )
{
// Must manually compare as Scm doesn't have an equals method
if ( that == null && originalScmInfo == null )
{
return true;
}
if ( ( that == null && originalScmInfo != null ) || ( that != null && originalScmInfo == null ) )
{
return false;
}
if ( that.size() != originalScmInfo.size() )
{
return false;
}
for ( java.util.Iterator i = originalScmInfo.entrySet().iterator(); i.hasNext(); )
{
java.util.Map.Entry entry = (java.util.Map.Entry) i.next();
org.apache.maven.model.Scm thatScm = (org.apache.maven.model.Scm) that.get( entry.getKey() );
org.apache.maven.model.Scm thisScm = (org.apache.maven.model.Scm) entry.getValue();
if ( thatScm == null && thisScm == null )
{
return true;
}
else if ( thatScm == null )
{
return false;
}
else if ( thisScm == null )
{
return true;
}
if ( thisScm.getConnection() != null ? !thisScm.getConnection().equals( thatScm.getConnection() )
: thatScm.getConnection() != null )
{
return false;
}
if ( thisScm.getDeveloperConnection() != null ? !thisScm.getDeveloperConnection().equals(
thatScm.getDeveloperConnection() ) : thatScm.getDeveloperConnection() != null )
{
return false;
}
if ( thisScm.getUrl() != null ? !thisScm.getUrl().equals( thatScm.getUrl() ) : thatScm.getUrl() != null )
{
return false;
}
if ( thisScm.getTag() != null ? !thisScm.getTag().equals( thatScm.getTag() ) : thatScm.getTag() != null )
{
return false;
}
if ( thisScm instanceof org.apache.maven.shared.release.scm.IdentifiedScm && thatScm instanceof org.apache.maven.shared.release.scm.IdentifiedScm )
{
org.apache.maven.shared.release.scm.IdentifiedScm thisIdentifiedScm = (org.apache.maven.shared.release.scm.IdentifiedScm) thisScm;
org.apache.maven.shared.release.scm.IdentifiedScm thatIdentifiedScm = (org.apache.maven.shared.release.scm.IdentifiedScm) thatScm;
if ( thisIdentifiedScm.getId() != null ? !thisIdentifiedScm.getId().equals( thatIdentifiedScm.getId() ) : thatIdentifiedScm.getId() != null )
{
return false;
}
}
}
return true;
}
public int hashCode()
{
int result = completedPhase != null ? completedPhase.hashCode() : 0;
result = 29 * result + ( scmReleaseLabel != null ? scmReleaseLabel.hashCode() : 0 );
result = 29 * result + ( additionalArguments != null ? additionalArguments.hashCode() : 0 );
result = 29 * result + ( preparationGoals != null ? preparationGoals.hashCode() : 0 );
result = 29 * result + ( completionGoals != null ? completionGoals.hashCode() : 0 );
result = 29 * result + ( pomFileName != null ? pomFileName.hashCode() : 0 );
result = 29 * result + ( checkModificationExcludes != null ? checkModificationExcludes.hashCode() : 0 );
result = 29 * result + ( scmTagBase != null ? scmTagBase.hashCode() : 0 );
result = 29 * result + ( scmBranchBase != null ? scmBranchBase.hashCode() : 0 );
result = 29 * result + ( scmUsername != null ? scmUsername.hashCode() : 0 );
result = 29 * result + ( scmPassword != null ? scmPassword.hashCode() : 0 );
result = 29 * result + ( scmId != null ? scmId.hashCode() : 0 );
result = 29 * result + ( scmSourceUrl != null ? scmSourceUrl.hashCode() : 0 );
result = 29 * result + ( scmPrivateKey != null ? scmPrivateKey.hashCode() : 0 );
result = 29 * result + ( scmPrivateKeyPassPhrase != null ? scmPrivateKeyPassPhrase.hashCode() : 0 );
result = 29 * result + ( workingDirectory != null ? workingDirectory.hashCode() : 0 );
result = 29 * result + ( scmUseEditMode ? 1 : 0 );
result = 29 * result + ( addSchema ? 1 : 0 );
result = 29 * result + ( generateReleasePoms ? 1 : 0 );
result = 29 * result + ( interactive ? 1 : 0 );
result = 29 * result + ( releaseVersions != null ? releaseVersions.hashCode() : 0 );
result = 29 * result + ( developmentVersions != null ? developmentVersions.hashCode() : 0 );
result = 29 * result + ( originalScmInfo != null ? originalScmInfo.hashCode() : 0 );
result = 29 * result + ( updateDependencies ? 1 : 0 );
result = 29 * result + ( useReleaseProfile ? 1 : 0 );
result = 29 * result + ( autoVersionSubmodules ? 1 : 0 );
result = 29 * result + ( snapshotReleasePluginAllowed ? 1 : 0 );
result = 29 * result + ( commitByProject ? 1 : 0 );
result = 29 * result + ( branchCreation ? 1 : 0 );
result = 29 * result + ( updateBranchVersions ? 1 : 0 );
result = 29 * result + ( updateWorkingCopyVersions ? 1 : 0 );
result = 29 * result + ( suppressCommitBeforeTagOrBranch ? 1 : 0 );
result = 29 * result + ( updateVersionsToSnapshot ? 1 : 0 );
result = 29 * result + ( allowTimestampedSnapshots ? 1 : 0 );
result = 29 * result + ( remoteTagging ? 1 : 0 );
result = 29 * result + ( localCheckout ? 1 : 0 );
result = 29 * result + ( pushChanges ? 1 : 0 );
result = 29 * result + ( defaultDevelopmentVersion != null ? defaultDevelopmentVersion.hashCode() : 0 );
result = 29 * result + ( scmRelativePathProjectDirectory != null ? scmRelativePathProjectDirectory.hashCode() : 0 );
result = 29 * result + ( checkoutDirectory != null ? checkoutDirectory.hashCode() : 0 );
result = 29 * result + ( performGoals != null ? performGoals.hashCode() : 0 );
result = 29 * result + ( defaultReleaseVersion != null ? defaultReleaseVersion.hashCode() : 0 );
result = 29 * result + ( scmReleasedPomRevision != null ? scmReleasedPomRevision.hashCode() : 0 );
return result;
}
]]>