summaryrefslogtreecommitdiffstats
path: root/common/api-parent
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-06-10 15:56:09 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-06-13 11:53:59 +0000
commitd8514c6bef58fefc2afff7f2e4b4dba3633085d1 (patch)
tree6f3eed8014c67e53f4d139af31c971bad6238e04 /common/api-parent
parent318b9e56d0b11a5ca4ea8da4879b4693bcf8763e (diff)
Enable checkstyle
Change-Id: Icb7ba90e26294b227d0bd393183ba33d99c2660b Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'common/api-parent')
-rw-r--r--common/api-parent/pom.xml81
1 files changed, 70 insertions, 11 deletions
diff --git a/common/api-parent/pom.xml b/common/api-parent/pom.xml
index 0a37c7918..d4f77cd7f 100644
--- a/common/api-parent/pom.xml
+++ b/common/api-parent/pom.xml
@@ -30,20 +30,79 @@
<artifactId>api-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
+
<build>
- <plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <!-- Override checkstyle configuration to fit Honeycomb coding style-->
+ <configLocation>honeycomb-checkstyle.xml</configLocation>
+ <includeTestResources>true</includeTestResources>
+ <!--TODO enable fail on violation after issues are resolved + set in as errors in checkstyle xml-->
+ </configuration>
+ <executions>
+
+ <!-- Override license check configuration to fit Honeycomb coding style-->
+ <execution>
+ <id>check-license</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <phase>process-sources</phase>
+ <configuration>
+ <headerLocation>HONEYCOMB_LICENSE.txt</headerLocation>
+ <failOnViolation>true</failOnViolation>
+ <failsOnError>true</failsOnError>
+ <outputFile>${project.build.directory}/checkstyle-license-result.xml</outputFile>
+ </configuration>
+ </execution>
+
+ <!-- Add logging checks from yangtools -->
+ <execution>
+ <id>check-logging</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <phase>process-sources</phase>
+ <configuration>
+ <failOnViolation>true</failOnViolation>
+ <configLocation>honeycomb-checkstyle-logging.xml</configLocation>
+ <consoleOutput>true</consoleOutput>
+ <includeTestSourceDirectory>true</includeTestSourceDirectory>
+ <sourceDirectory>${project.basedir}</sourceDirectory>
+ <includes>**\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat,**\/*.yang</includes>
+ <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/src/main/yang-gen-config\/,**\/src/main/yang-gen-sal\/,**\/src/main/xtend-gen\/,**\/src/main/yang\/</excludes>
+ <outputFile>${project.build.directory}/checkstyle-logging-result.xml</outputFile>
+ </configuration>
+ </execution>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <phase>process-sources</phase>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>io.fd.honeycomb.common</groupId>
+ <artifactId>honeycomb-checkstyle</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!-- Necessary for logging checks -->
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>checkstyle-logging</artifactId>
+ <version>${yangtools.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
- <version>${checkstyle.version}</version>
- <executions>
- <execution>
- <id>check-license</id>
- <goals>
- <goal>check</goal>
- </goals>
- <phase>none</phase>
- </execution>
- </executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>