Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven 2 Checkstyle configLocation

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?

like image 599
kukudas Avatar asked Jan 29 '09 09:01

kukudas


People also ask

How do I skip Checkstyle?

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.

How do you add Checkstyle to Pom?

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.


1 Answers

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.

like image 122
Clay Avatar answered Sep 21 '22 16:09

Clay