Skip to content

Commit e10e0e7

Browse files
committed
Add checkstyle as part of the Maven build to ensure coding standards compliance
1 parent a19c10d commit e10e0e7

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

pom.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
<javadoc.doclint.param/>
6262

6363
<!-- Dependencies [BUILD]: -->
64+
<maven-checkstyle-plugin.version>2.16</maven-checkstyle-plugin.version>
6465
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
6566
<maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
6667
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
@@ -99,6 +100,34 @@
99100
<javadoc.doclint.param>-Xdoclint:none</javadoc.doclint.param>
100101
</properties>
101102
</profile>
103+
<profile>
104+
<!-- maven-checkstyle-plugin required Java 7 or later -->
105+
<id>java-7-or-later-profile</id>
106+
<activation>
107+
<jdk>[1.7,)</jdk>
108+
</activation>
109+
<build>
110+
<plugins>
111+
<plugin>
112+
<groupId>org.apache.maven.plugins</groupId>
113+
<artifactId>maven-checkstyle-plugin</artifactId>
114+
<version>${maven-checkstyle-plugin.version}</version>
115+
<configuration>
116+
<failsOnError>true</failsOnError>
117+
<configLocation>google_checks.xml</configLocation>
118+
</configuration>
119+
<executions>
120+
<execution>
121+
<phase>verify</phase>
122+
<goals>
123+
<goal>checkstyle</goal>
124+
</goals>
125+
</execution>
126+
</executions>
127+
</plugin>
128+
</plugins>
129+
</build>
130+
</profile>
102131
<profile>
103132
<id>release-sign-artifacts</id>
104133
<activation>

0 commit comments

Comments
 (0)