diff --git a/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java b/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java index 636cd2aa..40341cc4 100644 --- a/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java +++ b/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java @@ -215,9 +215,22 @@ public class GitCommitIdMojo extends AbstractMojo { * Set this to {@code 'true'} to skip plugin execution. * @since 2.1.8 */ - @Parameter(property = "maven.gitcommitid.skip", defaultValue = "false") + @Parameter(defaultValue = "false") private boolean skip; + + /** + * Set this to {@code 'true'} to skip plugin execution via commandline. + * NOTE / WARNING: + * Do *NOT* set this property inside the configuration of your plugin. + * Please read + * https://github.com/ktoso/maven-git-commit-id-plugin/issues/315 + * to find out why. + * @since 2.2.4 + */ + @Parameter(property = "maven.gitcommitid.skip", defaultValue = "false") + private boolean skipViaCommandLine; + /** *
Set this to {@code 'true'} to only run once in a multi-module build. This probably won't "do the right thing" * 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 { sourceCharset = Charset.defaultCharset(); } - if (skip) { + if (skip || skipViaCommandLine) { log.info("skip is enabled, skipping execution!"); return; }