I have a project which has as maven dependency a jar file which includes a xml file where I stored my rules for checkstyle. I thought it would be ok to just use this configuration:
<configLocation>mycheckstyle.xml</configLocation>
My understanding is that the file should be searched on the classpath and my jar file is a Maven dependency so it should be found, however I get a resource not found exception.
Any suggestions?
If you want to disable checkstyle from your pom, you can add the checkstyle plugin to the pom and set the skip flag to prevent the check.
To generate the Checkstyle report as part of the Project Reports, add the Checkstyle Plugin in the <reporting> section of your pom. xml . Then, execute the site phase to generate the report.
Try adding a dependencies section to your plugin configuration.
E.g.,
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.example.whizbang</groupId>
<artifactId>build-tools</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</plugin>
See Maven Checkstyle Plugin - Multimodule Configuration for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With