Skip to content

Commit cc7d3b6

Browse files
BigMichi1michael-o
authored andcommitted
[MRELEASE-1099] Use shallow checkout/clone during release:perform
This closes #139
1 parent a197ada commit cc7d3b6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

maven-release-manager/src/main/mdo/release-descriptor.mdo

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,10 @@
941941
{
942942
return false;
943943
}
944+
if ( !java.util.Objects.equals( scmShallowClone, that.isScmShallowClone() ) )
945+
{
946+
return false;
947+
}
944948
if ( !java.util.Objects.equals( scmReleaseCommitComment, that.getScmReleaseCommitComment() ) )
945949
{
946950
return false;
@@ -1087,6 +1091,7 @@
10871091
result = 29 * result + java.util.Objects.hashCode( pomFileName );
10881092
result = 29 * result + java.util.Objects.hashCode( checkModificationExcludes );
10891093
result = 29 * result + java.util.Objects.hashCode( scmDevelopmentCommitComment );
1094+
result = 29 * result + java.util.Objects.hashCode( scmShallowClone );
10901095
result = 29 * result + java.util.Objects.hashCode( scmReleaseCommitComment );
10911096
result = 29 * result + java.util.Objects.hashCode( scmBranchCommitComment );
10921097
result = 29 * result + java.util.Objects.hashCode( scmRollbackCommitComment );

maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ public class PerformReleaseMojo
100100
@Parameter( property = "password" )
101101
private String password;
102102

103+
/**
104+
* When cloning a repository if it should be a shallow clone or a full clone.
105+
*/
106+
@Parameter( defaultValue = "true", property = "scmShallowClone" )
107+
private boolean scmShallowClone = true;
108+
103109
/**
104110
* Whether to use the default release profile (Maven 2 and 3) that adds sources and javadocs to the released
105111
* artifact, if appropriate. If set to true, the release plugin sets the property "<code>performRelease</code>" to
@@ -183,6 +189,8 @@ public void execute()
183189
releaseDescriptor.setScmPassword( password );
184190
}
185191

192+
releaseDescriptor.setScmShallowClone( scmShallowClone );
193+
186194
releaseDescriptor.setLocalCheckout( localCheckout );
187195

188196
releaseDescriptor.setCheckoutDirectory( workingDirectory.getAbsolutePath() );

0 commit comments

Comments
 (0)