diff --git a/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java b/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java index a6d03c2bd..a45fd1377 100644 --- a/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java +++ b/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java @@ -464,4 +464,12 @@ public interface ReleaseDescriptor void setScmRelativePathProjectDirectory( String scmRelativePathProjectDirectory ); void setScmSourceUrl( String scmUrl ); + + /** + * Get whether the "--pin-externals" option in svn copy commands is enabled + * which is new in Subversion 1.9. + * + * @return boolean + */ + boolean isPinExternals(); } diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java index 262b21d4a..9fd335ceb 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java @@ -249,6 +249,8 @@ public void write( BuilderReleaseDescriptor config, File file ) properties.setProperty( "remoteTagging", Boolean.toString( config.isRemoteTagging() ) ); + properties.setProperty( "pinExternals", Boolean.toString( config.isPinExternals() ) ); + properties.setProperty( "pushChanges", Boolean.toString( config.isPushChanges() ) ); if ( config.getWorkItem() != null ) diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptorBuilder.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptorBuilder.java index 745dc4da6..8e71be924 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptorBuilder.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptorBuilder.java @@ -440,6 +440,12 @@ public ReleaseDescriptorBuilder addDependencyDevelopmentVersion( String dependen return this; } + public ReleaseDescriptorBuilder setPinExternals( boolean pinExternals ) + { + releaseDescriptor.setPinExternals( pinExternals ); + return this; + } + BuilderReleaseDescriptor build() { return releaseDescriptor; diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java index bc48cc563..0da9629cd 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java @@ -161,6 +161,11 @@ public static void copyPropertiesToReleaseDescriptor( Properties properties, Rel String remoteTaggingStr = properties.getProperty( "remoteTagging" ); builder.setRemoteTagging( Boolean.valueOf( remoteTaggingStr ) ); } + if ( properties.containsKey( "pinExternals" ) ) + { + String pinExternals = properties.getProperty( "pinExternals" ); + builder.setPinExternals( Boolean.valueOf( pinExternals ) ); + } if ( properties.containsKey( "pushChanges" ) ) { String pushChanges = properties.getProperty( "pushChanges" ); diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmBranchPhase.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmBranchPhase.java index d1d85b667..8bbde41c4 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmBranchPhase.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmBranchPhase.java @@ -108,6 +108,7 @@ public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnviro scmBranchParameters.setMessage( releaseDescriptor.getScmCommentPrefix() + "copy for branch " + branchName ); scmBranchParameters.setRemoteBranching( releaseDescriptor.isRemoteTagging() ); scmBranchParameters.setScmRevision( releaseDescriptor.getScmReleasedPomRevision() ); + scmBranchParameters.setPinExternals( releaseDescriptor.isPinExternals() ); result = provider.branch( repository, fileSet, branchName, scmBranchParameters ); } @@ -143,6 +144,10 @@ public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvir logInfo( result, " To SCM URL: " + releaseDescriptor.getScmBranchBase() ); } logInfo( result, " with label: '" + releaseDescriptor.getScmReleaseLabel() + "'" ); + if ( releaseDescriptor.isPinExternals() ) + { + logInfo( result, " with pinned externals" ); + } result.setResultCode( ReleaseResult.SUCCESS ); diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmTagPhase.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmTagPhase.java index 5f52d3926..6f4f67d4f 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmTagPhase.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmTagPhase.java @@ -120,6 +120,7 @@ public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnviro new ScmTagParameters( releaseDescriptor.getScmCommentPrefix() + "copy for tag " + tagName ); scmTagParameters.setRemoteTagging( releaseDescriptor.isRemoteTagging() ); scmTagParameters.setScmRevision( releaseDescriptor.getScmReleasedPomRevision() ); + scmTagParameters.setPinExternals( releaseDescriptor.isPinExternals() ); if ( getLogger().isDebugEnabled() ) { getLogger().debug( @@ -127,6 +128,8 @@ public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnviro getLogger().debug( "ScmTagPhase :: scmTagParameters scmRevision " + releaseDescriptor.getScmReleasedPomRevision() ); getLogger().debug( "ScmTagPhase :: fileSet " + fileSet ); + getLogger().debug( + "ScmTagPhase :: scmTagParameters pinExternals " + releaseDescriptor.isPinExternals() ); } result = provider.tag( repository, fileSet, tagName, scmTagParameters ); } @@ -168,6 +171,10 @@ public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvir logInfo( result, "Full run would be tagging remotely " + basedirAlignedReleaseDescriptor.getScmSourceUrl() + " with label: '" + releaseDescriptor.getScmReleaseLabel() + "'" ); } + if ( releaseDescriptor.isPinExternals() ) + { + logInfo( result, "Full run would pin externals" ); + } result.setResultCode( ReleaseResult.SUCCESS ); diff --git a/maven-release-manager/src/main/mdo/release-descriptor.mdo b/maven-release-manager/src/main/mdo/release-descriptor.mdo index b63c4b455..d1d49960e 100644 --- a/maven-release-manager/src/main/mdo/release-descriptor.mdo +++ b/maven-release-manager/src/main/mdo/release-descriptor.mdo @@ -563,6 +563,18 @@ + + pinExternals + 3.0.0+ + boolean + false + + Enable the "--pin-externals" option in svn copy commands which is new in Subversion 1.9. + NOTE : Currently only implemented with Subversion. + (https://issues.apache.org/jira/browse/SCM-805) + + +