@@ -74,6 +74,13 @@ public class InstallHooksMojo extends AbstractMavenGitCodeFormatMojo {
74
74
@ Parameter (property = "gcf.preCommitHookPipeline" , defaultValue = "" )
75
75
private String preCommitHookPipeline ;
76
76
77
+ /**
78
+ * If present, this value will be passed to '-T, --threads Thread count, for instance 2.0C where C
79
+ * is core multiplied'
80
+ */
81
+ @ Parameter (property = "gcf.hookMavenThreadCount" )
82
+ private String hookMavenThreadCount ;
83
+
77
84
public void execute () throws MojoExecutionException {
78
85
if (!isExecutionRoot ()) {
79
86
getLog ().debug ("Not in execution root. Do not execute." );
@@ -143,11 +150,14 @@ private String mavenCliArguments() {
143
150
.filter (prop -> System .getProperty (prop ) != null )
144
151
.map (prop -> "-D" + prop + "=" + System .getProperty (prop ));
145
152
146
- Stream <String > properties = Stream .concat (propagatedProperties , Stream .of (propertiesToAdd ));
153
+ Stream <String > arguments = Stream .concat (propagatedProperties , Stream .of (propertiesToAdd ));
147
154
if (preCommitHookPipeline != null && !preCommitHookPipeline .isEmpty ()) {
148
- properties = Stream .concat (properties , Stream .of (preCommitHookPipeline ));
155
+ arguments = Stream .concat (arguments , Stream .of (preCommitHookPipeline ));
156
+ }
157
+ if (hookMavenThreadCount != null && !hookMavenThreadCount .isEmpty ()) {
158
+ arguments = Stream .concat (arguments , Stream .of ("-T " + hookMavenThreadCount ));
149
159
}
150
- return properties .collect (Collectors .joining (" " ));
160
+ return arguments .collect (Collectors .joining (" " ));
151
161
}
152
162
153
163
private Path prepareHooksDirectory () {
0 commit comments