Skip to content

Commit f39b6b2

Browse files
committed
Add checkstyle to the build process and enable it for the Nicira NVP plugin
1 parent a196fbc commit f39b6b2

4 files changed

Lines changed: 65 additions & 0 deletions

File tree

parents/checkstyle/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<name>Apache CloudStack Checkstyle Configuration</name>
4+
<groupId>org.apache.cloudstack</groupId>
5+
<artifactId>checkstyle</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
</project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
4+
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
5+
6+
<module name="Checker">
7+
<module name="FileTabCharacter">
8+
<property name="eachLine" value="true"/>
9+
</module>
10+
11+
<module name="RegexpSingleline">
12+
<!-- \s matches whitespace character, $ matches end of line. -->
13+
<property name="format" value="\s+$"/>
14+
<property name="message" value="Line has trailing spaces."/>
15+
</module>
16+
<module name="TreeWalker">
17+
<module name="RedundantImport"/>
18+
<module name="UnusedImports"/>
19+
</module>
20+
21+
</module>

plugins/network-elements/nicira-nvp/pom.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,39 @@
2626
<version>4.3.0-SNAPSHOT</version>
2727
<relativePath>../../pom.xml</relativePath>
2828
</parent>
29+
30+
<build>
31+
<plugins>
32+
<plugin>
33+
<groupId>org.apache.maven.plugins</groupId>
34+
<artifactId>maven-checkstyle-plugin</artifactId>
35+
<version>${cs.checkstyle.version}</version>
36+
<dependencies>
37+
<dependency>
38+
<groupId>org.apache.cloudstack</groupId>
39+
<artifactId>checkstyle</artifactId>
40+
<version>0.0.1-SNAPSHOT</version>
41+
</dependency>
42+
</dependencies>
43+
<executions>
44+
<execution>
45+
<phase>process-sources</phase>
46+
<goals>
47+
<goal>check</goal>
48+
</goals>
49+
</execution>
50+
</executions>
51+
<configuration>
52+
<failsOnError>true</failsOnError>
53+
<configLocation>tooling/checkstyle.xml</configLocation>
54+
<consoleOutput>true</consoleOutput>
55+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
56+
<sourceDirectory>${project.basedir}</sourceDirectory>
57+
<includes>**\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat</includes>
58+
<excludes>**\/target\/,**\/bin\/</excludes>
59+
</configuration>
60+
</plugin>
61+
</plugins>
62+
</build>
63+
2964
</project>

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
<cs.target.dir>target</cs.target.dir>
8787
<cs.daemon.version>1.0.10</cs.daemon.version>
8888
<cs.jna.version>4.0.0</cs.jna.version>
89+
<cs.checkstyle.version>2.10</cs.checkstyle.version>
8990
</properties>
9091

9192
<distributionManagement>
@@ -174,6 +175,7 @@
174175
<module>services</module>
175176
<module>maven-standard</module>
176177
<module>quickcloud</module>
178+
<module>parents/checkstyle</module>
177179
</modules>
178180

179181
<dependencyManagement>

0 commit comments

Comments
 (0)