Skip to content

Commit f6b1ad0

Browse files
authored
Merge pull request #6 from domkun/GH-5-config-properties
GH-5: Add ability to configure the plugin using system properties
2 parents 3882927 + 8e40676 commit f6b1ad0

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

README.adoc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,28 @@ build:
219219
- merged-gl-code-quality-report.json
220220
----
221221

222+
== CLI usage
223+
224+
The plugin may also be used and configured using the Maven CLI. Available configuration properties are:
225+
226+
* `glcqp.spotbugsEnabled`
227+
* `glcqp.spotbugsInputFile`
228+
* `glcqp.checkstyleEnabled`
229+
* `glcqp.checkstyeInputFile`
230+
* `glcqp.outputFile`
231+
232+
They are used like this:
233+
234+
[source,shell,subs="+attributes"]
235+
----
236+
mvn de.chkal.maven:gitlab-code-quality-plugin:{version_stable}:check \
237+
-Dglcqp.spotbugsEnabled=true \
238+
-Dglcqp.spotbugsInputFile=target/spotbugsXml.xml \
239+
-Dglcqp.checkstyleEnabled=true \
240+
-Dglcqp.checkstyeInputFile=target/checkstyle-result.xml \
241+
-Dglcqp.outputFile=target/gl-code-quality-report.json
242+
----
243+
222244
== Using the latest snapshots
223245

224246
The latest snapshots of this plugin are deployed to the Sonatype OSSRH repository.

src/main/java/de/chkal/maven/gitlab/codequality/GenerateMojo.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
@Mojo(name = "generate", defaultPhase = LifecyclePhase.VERIFY, threadSafe = true)
2121
public class GenerateMojo extends AbstractMojo {
2222

23-
@Parameter(defaultValue = "true")
23+
@Parameter(property = "glcqp.spotbugsEnabled", defaultValue = "true")
2424
public boolean spotbugsEnabled;
2525

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

29-
@Parameter(defaultValue = "true")
29+
@Parameter(property = "glcqp.checkstyleEnabled", defaultValue = "true")
3030
public boolean checkstyleEnabled;
3131

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

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

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

0 commit comments

Comments
 (0)