@@ -4,23 +4,15 @@ Checkstyle config for all JAVA projects.
44
55## Usage
66
7- Add this repository as a submodule of your main project by creating a ` .gitmodules ` file:
8- ```
9- [submodule "checkstyle-config"]
10- path = checkstyle-config
11- url = https://github.com/aboutbits/java-checkstyle-config
12- branch = main
13- ```
14-
157Add the ` maven-checkstyle-plugin ` to your ` pom.xml ` :
168``` xml
179<plugin >
1810 <groupId >org.apache.maven.plugins</groupId >
1911 <artifactId >maven-checkstyle-plugin</artifactId >
2012 <version >3.5.0</version >
2113 <configuration >
22- <configLocation >checkstyle-config/checkstyle .xml</configLocation >
23- <suppressionsLocation >checkstyle-config/checkstyle- suppressions.xml</suppressionsLocation >
14+ <configLocation >checkstyle.xml</configLocation >
15+ <suppressionsLocation >checkstyle-suppressions.xml</suppressionsLocation >
2416 <includeTestSourceDirectory >true</includeTestSourceDirectory >
2517 <consoleOutput >true</consoleOutput >
2618 <failsOnError >true</failsOnError >
@@ -41,21 +33,20 @@ Add the `maven-checkstyle-plugin` to your `pom.xml`:
4133 <artifactId >checkstyle</artifactId >
4234 <version >10.18.1</version >
4335 </dependency >
36+ <dependency >
37+ <groupId >it.aboutbits</groupId >
38+ <artifactId >java-checkstyle-config</artifactId >
39+ <version >1.0.0</version >
40+ </dependency >
4441 </dependencies >
4542</plugin >
4643```
4744
48- For use with github-actions, you will also have to tell ` actions/checkout ` to also recurse submodules:
49- ``` yaml
50- - uses : actions/checkout@v4
51- with :
52- submodules : ' true'
53- ` ` `
54-
5545** Configure your IDE:**
56- Go to ` Settings` then search for "checkstyle".
57- Add a new checkstyle configuration and select the `checkstyle-config/checkstyle.xml` file.
58- Set the property `org.checkstyle.sun.suppressionfilter.config` to `checkstyle-config/checkstyle-suppressions.xml`
46+ First you need to run ` mvn verify ` once.
47+ In your IDE go to ` Settings ` then search for "checkstyle".
48+ Add a new checkstyle configuration and select the ` target/checkstyle-checker.xml ` file.
49+ Set the property ` org.checkstyle.sun.suppressionfilter.config ` to ` checkstyle-suppressions.xml `
5950
6051## Information
6152
0 commit comments