Skip to content

Commit dd061f1

Browse files
author
TheSnoozer
authored
Merge pull request #319 from TheSnoozer/master
#315: deploying the workaround used inside maven-surefire-plugin to be able to skip via configuration and commandline properly
2 parents 7d140c3 + 9b83242 commit dd061f1

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/main/java/pl/project13/maven/git/GitCommitIdMojo.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,22 @@ public class GitCommitIdMojo extends AbstractMojo {
215215
* Set this to {@code 'true'} to skip plugin execution.
216216
* @since 2.1.8
217217
*/
218-
@Parameter(property = "maven.gitcommitid.skip", defaultValue = "false")
218+
@Parameter(defaultValue = "false")
219219
private boolean skip;
220220

221+
222+
/**
223+
* Set this to {@code 'true'} to skip plugin execution via commandline.
224+
* NOTE / WARNING:
225+
* Do *NOT* set this property inside the configuration of your plugin.
226+
* Please read
227+
* https://github.com/ktoso/maven-git-commit-id-plugin/issues/315
228+
* to find out why.
229+
* @since 2.2.4
230+
*/
231+
@Parameter(property = "maven.gitcommitid.skip", defaultValue = "false")
232+
private boolean skipViaCommandLine;
233+
221234
/**
222235
* <p>Set this to {@code 'true'} to only run once in a multi-module build. This probably won't "do the right thing"
223236
* if your project has more than one git repository. If you use this with {@code 'generateGitPropertiesFile'},
@@ -323,7 +336,7 @@ public void execute() throws MojoExecutionException {
323336
sourceCharset = Charset.defaultCharset();
324337
}
325338

326-
if (skip) {
339+
if (skip || skipViaCommandLine) {
327340
log.info("skip is enabled, skipping execution!");
328341
return;
329342
}

0 commit comments

Comments
 (0)