Repository navigation
System user property to skip? #268
Description
Activity
If that's implemented this way by these other plugins it seems we should do it too.
Would you be able to send in a PR?The plugin is not very actively developed by myself, however I'm happy to review/merge/and release if you'd provide a PR for this.
Should be super easy to add this.
maven-surefire-plugin has this option:
https://maven.apache.org/surefire/maven-surefire-plugin/examples/skipping-test.htmlMagic is hidden here:
https://github.com/apache/maven-surefire/blob/master/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java#L152Based on https://maven.apache.org/guides/plugin/guide-java-plugin-development#Parameters
Defining a parameter is as simple as creating an instance variable in the mojo and adding the proper annotations. Listed below is an example of a parameter for the simple mojo:
/** * The greeting to display. */ @Parameter( property = "sayhi.greeting", defaultValue = "Hello World!" ) private String greeting;
The portion before the annotations is the description of the parameter. The parameter annotation identifies the variable as a mojo parameter. The defaultValue parameter of the annotation defines the default value for the variable. This value can include expressions which reference the project, such as "${project.version}" (more can be found in the "Parameter Expressions" document). The property parameter can be used to allow configuration of the mojo parameter from the command line by referencing a system property that the user sets via the -D option.
- added a commit that references this issue
on Mar 16, 2017 This is great, was just looking for something like this. Any idea when the 2.2.3 version will be released to Maven Central?
It would be nice to have if this Maven plugin had a -D user system property to skip its execution...
I realize that you can use the following in a POM, but can't see how to do this from CLI w.o. changing code:
As far as I understand Maven, support for being able to do something like
mvn -Dmaven.gitcommitid.skip=true packagewould have to be coded into the Mojo (although I may be wrong).FYI: The *.skip suffix naming convention seems to be what all of the core Maven plugins use; e.g.
maven.javadoc.ski,maven.source.skipetc. or alsocheckstyle.skip,findbugs.skip,pmd.skip,cpd.skip, etc.