Opower Engineering checkstyle for Java and Scala artifacts.
To run checkstyle add the following plugin to your Maven POM file's plugins
section.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.opower</groupId>
<artifactId>checkstyle</artifactId>
<version>${version.opower.checkstyle}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>checkstyle</id>
<phase>compile</phase>
<goals>
<goal>checkstyle</goal>
</goals>
<configuration>
<excludes>${maven.checkstyle.excludes}</excludes>
<configLocation>opower_checks.xml</configLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<failsOnError>true</failsOnError>
<consoleOutput>true</consoleOutput>
</configuration>
</execution>
<execution>
<id>checkstyle-libs</id>
<phase>compile</phase>
<goals>
<goal>checkstyle</goal>
</goals>
<configuration>
<skip>${maven.checkstyle.checks.opower_libs_checks}</skip>
<excludes>${maven.checkstyle.excludes}</excludes>
<configLocation>opower_libs_checks.xml</configLocation>
<includeTestSourceDirectory>false</includeTestSourceDirectory>
<failsOnError>true</failsOnError>
<consoleOutput>true</consoleOutput>
</configuration>
</execution>
</executions>
</plugin>
The stanza above includes 2 checkstyle executions. The first, checkstyle
, runs opower_checks.xml
.
The second, checkstyle-libs
runs opower_libs_checks.xml
and can be disabled by setting the
maven.checkstyle.checks.opower_libs_checks
property to true
.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request