Skip to content

Commit

Permalink
GH-5: Add ability to configure the plugin using system properties
Browse files Browse the repository at this point in the history
  • Loading branch information
domkun committed Feb 19, 2024
1 parent 3882927 commit 590847a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
22 changes: 22 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,28 @@ build:
- merged-gl-code-quality-report.json
----

== CLI usage

The plugin may also be used and configured using the Maven CLI. Available configuration properties are:

* `glcqp.spotbugsEnabled`
* `glcqp.spotbugsInputFile`
* `glcqp.checkstyleEnabled`
* `glcqp.checkstyeInputFile`
* `glcqp.outputFile`

They are used like this:

[source,shell]
----
mvn de.chkal.maven:gitlab-code-quality-plugin:{version_stable}:check \
-Dglcqp.spotbugsEnabled=true \
-Dglcqp.spotbugsInputFile=target/spotbugsXml.xml \
-Dglcqp.checkstyleEnabled=true \
-Dglcqp.checkstyeInputFile=target/checkstyle-result.xml \
-Dglcqp.outputFile=target/gl-code-quality-report.json
----

== Using the latest snapshots

The latest snapshots of this plugin are deployed to the Sonatype OSSRH repository.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
@Mojo(name = "generate", defaultPhase = LifecyclePhase.VERIFY, threadSafe = true)
public class GenerateMojo extends AbstractMojo {

@Parameter(defaultValue = "true")
@Parameter(property = "glcqp.spotbugsEnabled", defaultValue = "true")
public boolean spotbugsEnabled;

@Parameter(defaultValue = "${project.build.directory}/spotbugsXml.xml")
@Parameter(property = "glcqp.spotbugsInputFile", defaultValue = "${project.build.directory}/spotbugsXml.xml")
public File spotbugsInputFile;

@Parameter(defaultValue = "true")
@Parameter(property = "glcqp.checkstyleEnabled", defaultValue = "true")
public boolean checkstyleEnabled;

@Parameter(defaultValue = "${project.build.directory}/checkstyle-result.xml")
@Parameter(property = "glcqp.checkstyeInputFile", defaultValue = "${project.build.directory}/checkstyle-result.xml")
public File checkstyleInputFile;

@Parameter(defaultValue = "${project.build.directory}/gl-code-quality-report.json")
@Parameter(property = "glcqp.outputFile", defaultValue = "${project.build.directory}/gl-code-quality-report.json")
public File outputFile;

@Parameter(defaultValue = "${project}", readonly = true, required = true)
Expand Down

0 comments on commit 590847a

Please sign in to comment.