@@ -11,15 +11,74 @@ image::.readme/gitlab-merge-request-widget.png[]
1111
1212== Usage
1313
14+ === Step 1: Set up SpotBugs and/or Checkstyle
15+
1416As this plugin processes XML reports of other code quality tools, you have to set up
15- the Maven plugins for SpotBugs and Checkstyle yourself before adding the plugin .
17+ the Maven plugins for SpotBugs and/or Checkstyle first .
1618
17- Then, just add the following plugin definition to your `pom.xml` :
19+ Such a setup could look like this :
1820
1921[source,xml,subs="+attributes"]
2022----
2123<project>
24+ <build>
25+ <plugins>
26+
27+ <!-- SpotBugs -->
28+ <plugin>
29+ <groupId>com.github.spotbugs</groupId>
30+ <artifactId>spotbugs-maven-plugin</artifactId>
31+ <version>4.7.3.3</version>
32+ <executions>
33+ <execution>
34+ <phase>verify</phase>
35+ <goals>
36+ <goal>spotbugs</goal>
37+ </goals>
38+ </execution>
39+ </executions>
40+ </plugin>
41+
42+ <!-- Checkstyle -->
43+ <plugin>
44+ <groupId>org.apache.maven.plugins</groupId>
45+ <artifactId>maven-checkstyle-plugin</artifactId>
46+ <version>3.2.1</version>
47+ <executions>
48+ <execution>
49+ <phase>verify</phase>
50+ <goals>
51+ <goal>checkstyle</goal>
52+ </goals>
53+ </execution>
54+ </executions>
55+ <configuration>
56+ <configLocation>
57+ https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/main/resources/google_checks.xml
58+ </configLocation>
59+ <linkXRef>false</linkXRef>
60+ </configuration>
61+ <dependencies>
62+ <dependency>
63+ <groupId>com.puppycrawl.tools</groupId>
64+ <artifactId>checkstyle</artifactId>
65+ <version>10.9.3</version>
66+ </dependency>
67+ </dependencies>
68+ </plugin>
2269
70+ </plugins>
71+ </build>
72+ </project>
73+ ----
74+
75+ === Step 2: Add the plugin to your pom.xml
76+
77+ Now add the following plugin definition to your `pom.xml`:
78+
79+ [source,xml,subs="+attributes"]
80+ ----
81+ <project>
2382 <build>
2483 <plugins>
2584
@@ -33,6 +92,7 @@ Then, just add the following plugin definition to your `pom.xml`:
3392 <version>{version_stable}</version>
3493 <executions>
3594 <execution>
95+ <phase>verify</phase>
3696 <goals>
3797 <goal>generate</goal>
3898 </goals>
@@ -55,7 +115,9 @@ generate the following JSON file:
55115
56116* `target/gl-code-quality-report.json`
57117
58- Now you will have to tell GitLab about this file by modifying your `.gitlab-ci.yml` file like this:
118+ === Step 3: Add the plugin to your pom.xml
119+
120+ Finally, you will have to tell GitLab about generated JSON file by modifying your `.gitlab-ci.yml` file like this:
59121
60122[source,yaml]
61123----
0 commit comments