Skip to content

Commit bf8717b

Browse files
committed
Checkstyle is now enforced across most modules.
Also, many modules were not being built by Travis, since they were not included in the root pom.xml. By changing the Travis config to use `mvn verify` instead of `mvn test`, we ensure that the checkstyle plugin will run, since [by default](https://maven.apache.org/plugins/maven-checkstyle-plugin/check-mojo.html) it is bound to the verify [phase](https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference).
1 parent 4f6fc48 commit bf8717b

File tree

33 files changed

+415
-50
lines changed

33 files changed

+415
-50
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ env:
66
before_install:
77
- openssl aes-256-cbc -K $encrypted_99d8b304f94b_key -iv $encrypted_99d8b304f94b_iv -in service-account.json.enc -out service-account.json -d
88

9-
script: mvn test
9+
script: mvn verify
1010
after_success:
1111
- mvn clean cobertura:cobertura coveralls:report

appengine/analytics/pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<packaging>war</packaging>
66
<version>1.0-SNAPSHOT</version>
77
<groupId>com.example.managedvms</groupId>
8-
<artifactId>analytics</artifactId>
8+
<artifactId>appengine-analytics</artifactId>
99
<dependencies>
1010
<dependency>
1111
<groupId>org.apache.httpcomponents</groupId>
@@ -49,6 +49,20 @@
4949
<promote>true</promote>
5050
</configuration>
5151
</plugin>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-checkstyle-plugin</artifactId>
55+
<version>2.17</version>
56+
<configuration>
57+
<configLocation>../../google-checks.xml</configLocation>
58+
<consoleOutput>true</consoleOutput>
59+
<failOnViolation>true</failOnViolation>
60+
<failsOnError>true</failsOnError>
61+
</configuration>
62+
<executions>
63+
<execution><goals><goal>check</goal></goals></execution>
64+
</executions>
65+
</plugin>
5266
</plugins>
5367
</build>
5468
</project>

appengine/appidentity/pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Copyright 2015 Google Inc. All Rights Reserved.
2020
<packaging>war</packaging>
2121
<version>1.0-SNAPSHOT</version>
2222
<groupId>com.example.appengine</groupId>
23-
<artifactId>appidentity</artifactId>
23+
<artifactId>appengine-appidentity</artifactId>
2424

2525
<properties>
2626
<appengine.target.version>1.9.30</appengine.target.version>
@@ -107,6 +107,20 @@ Copyright 2015 Google Inc. All Rights Reserved.
107107
<artifactId>gcloud-maven-plugin</artifactId>
108108
<version>2.0.9.90.v20151210</version>
109109
</plugin>
110+
<plugin>
111+
<groupId>org.apache.maven.plugins</groupId>
112+
<artifactId>maven-checkstyle-plugin</artifactId>
113+
<version>2.17</version>
114+
<configuration>
115+
<configLocation>../../google-checks.xml</configLocation>
116+
<consoleOutput>true</consoleOutput>
117+
<failOnViolation>true</failOnViolation>
118+
<failsOnError>true</failsOnError>
119+
</configuration>
120+
<executions>
121+
<execution><goals><goal>check</goal></goals></execution>
122+
</executions>
123+
</plugin>
110124
</plugins>
111125
</build>
112126
</project>

appengine/appidentity/src/main/java/com/example/appengine/appidentity/IdentityServlet.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
package com.example.appengine.appidentity;
1818

1919
import com.google.apphosting.api.ApiProxy;
20-
import com.google.apphosting.api.ApiProxy.Environment;
2120

2221
import java.io.IOException;
23-
import java.io.PrintWriter;
2422

2523
import javax.servlet.http.HttpServlet;
2624
import javax.servlet.http.HttpServletRequest;

appengine/cloudsql/pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<packaging>war</packaging>
66
<version>1.0-SNAPSHOT</version>
77
<groupId>com.example.managedvms</groupId>
8-
<artifactId>cloudsql</artifactId>
8+
<artifactId>appengine-cloudsql</artifactId>
99
<dependencies>
1010
<dependency>
1111
<groupId>javax.servlet</groupId>
@@ -51,6 +51,20 @@
5151
<promote>true</promote>
5252
</configuration>
5353
</plugin>
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-checkstyle-plugin</artifactId>
57+
<version>2.17</version>
58+
<configuration>
59+
<configLocation>../../google-checks.xml</configLocation>
60+
<consoleOutput>true</consoleOutput>
61+
<failOnViolation>true</failOnViolation>
62+
<failsOnError>true</failsOnError>
63+
</configuration>
64+
<executions>
65+
<execution><goals><goal>check</goal></goals></execution>
66+
</executions>
67+
</plugin>
5468
</plugins>
5569
</build>
5670
</project>

appengine/cloudstorage/pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<packaging>war</packaging>
66
<version>1.0-SNAPSHOT</version>
77
<groupId>com.example.managedvms</groupId>
8-
<artifactId>cloudstorage</artifactId>
8+
<artifactId>appengine-cloudstorage</artifactId>
99
<dependencies>
1010
<dependency>
1111
<groupId>javax.servlet</groupId>
@@ -49,6 +49,20 @@
4949
<promote>true</promote>
5050
</configuration>
5151
</plugin>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-checkstyle-plugin</artifactId>
55+
<version>2.17</version>
56+
<configuration>
57+
<configLocation>../../google-checks.xml</configLocation>
58+
<consoleOutput>true</consoleOutput>
59+
<failOnViolation>true</failOnViolation>
60+
<failsOnError>true</failsOnError>
61+
</configuration>
62+
<executions>
63+
<execution><goals><goal>check</goal></goals></execution>
64+
</executions>
65+
</plugin>
5266
</plugins>
5367
</build>
5468
</project>

appengine/datastore/pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<packaging>war</packaging>
66
<version>1.0-SNAPSHOT</version>
77
<groupId>com.example.managedvms</groupId>
8-
<artifactId>datastore</artifactId>
8+
<artifactId>appengine-datastore</artifactId>
99
<dependencies>
1010
<dependency>
1111
<groupId>javax.servlet</groupId>
@@ -49,6 +49,20 @@
4949
<promote>true</promote>
5050
</configuration>
5151
</plugin>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-checkstyle-plugin</artifactId>
55+
<version>2.17</version>
56+
<configuration>
57+
<configLocation>../../google-checks.xml</configLocation>
58+
<consoleOutput>true</consoleOutput>
59+
<failOnViolation>true</failOnViolation>
60+
<failsOnError>true</failsOnError>
61+
</configuration>
62+
<executions>
63+
<execution><goals><goal>check</goal></goals></execution>
64+
</executions>
65+
</plugin>
5266
</plugins>
5367
</build>
5468
</project>

appengine/disk/pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<packaging>war</packaging>
66
<version>1.0-SNAPSHOT</version>
77
<groupId>com.example.managedvms</groupId>
8-
<artifactId>disk</artifactId>
8+
<artifactId>appengine-disk</artifactId>
99
<dependencies>
1010
<dependency>
1111
<groupId>javax.servlet</groupId>
@@ -41,6 +41,20 @@
4141
<artifactId>gcloud-maven-plugin</artifactId>
4242
<version>2.0.9.90.v20151210</version>
4343
</plugin>
44+
<plugin>
45+
<groupId>org.apache.maven.plugins</groupId>
46+
<artifactId>maven-checkstyle-plugin</artifactId>
47+
<version>2.17</version>
48+
<configuration>
49+
<configLocation>../../google-checks.xml</configLocation>
50+
<consoleOutput>true</consoleOutput>
51+
<failOnViolation>true</failOnViolation>
52+
<failsOnError>true</failsOnError>
53+
</configuration>
54+
<executions>
55+
<execution><goals><goal>check</goal></goals></execution>
56+
</executions>
57+
</plugin>
4458
</plugins>
4559
</build>
4660
</project>

appengine/disk/src/main/java/com/example/managedvms/disk/DiskServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc
4646
StringBuffer sb = new StringBuffer();
4747
List<String> strings = Files.readAllLines(tmpFile, StandardCharsets.US_ASCII);
4848
for (String s : strings) {
49-
sb.append(s+"\n");
49+
sb.append(s + "\n");
5050
}
5151
PrintWriter out = resp.getWriter();
5252
resp.setContentType("text/plain");

appengine/extending-runtime/pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<packaging>war</packaging>
66
<version>1.0-SNAPSHOT</version>
77
<groupId>com.example.managedvms</groupId>
8-
<artifactId>extendingruntime</artifactId>
8+
<artifactId>appengine-extendingruntime</artifactId>
99
<properties>
1010
<writeable.directory></writeable.directory>
1111
<gcloud.sdk.directory></gcloud.sdk.directory>
@@ -58,6 +58,20 @@
5858
</custom_entrypoint>
5959
</configuration>
6060
</plugin>
61+
<plugin>
62+
<groupId>org.apache.maven.plugins</groupId>
63+
<artifactId>maven-checkstyle-plugin</artifactId>
64+
<version>2.17</version>
65+
<configuration>
66+
<configLocation>../../google-checks.xml</configLocation>
67+
<consoleOutput>true</consoleOutput>
68+
<failOnViolation>true</failOnViolation>
69+
<failsOnError>true</failsOnError>
70+
</configuration>
71+
<executions>
72+
<execution><goals><goal>check</goal></goals></execution>
73+
</executions>
74+
</plugin>
6175
</plugins>
6276
</build>
6377
</project>

appengine/helloworld-mvm/pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<packaging>war</packaging>
66
<version>1.0-SNAPSHOT</version>
77
<groupId>com.example.managedvms</groupId>
8-
<artifactId>helloworld</artifactId>
8+
<artifactId>appengine-helloworld-mvm</artifactId>
99
<dependencies>
1010
<dependency>
1111
<groupId>javax.servlet</groupId>
@@ -41,6 +41,20 @@
4141
<artifactId>gcloud-maven-plugin</artifactId>
4242
<version>2.0.9.90.v20151210</version>
4343
</plugin>
44+
<plugin>
45+
<groupId>org.apache.maven.plugins</groupId>
46+
<artifactId>maven-checkstyle-plugin</artifactId>
47+
<version>2.17</version>
48+
<configuration>
49+
<configLocation>../../google-checks.xml</configLocation>
50+
<consoleOutput>true</consoleOutput>
51+
<failOnViolation>true</failOnViolation>
52+
<failsOnError>true</failsOnError>
53+
</configuration>
54+
<executions>
55+
<execution><goals><goal>check</goal></goals></execution>
56+
</executions>
57+
</plugin>
4458
</plugins>
4559
</build>
4660
</project>

appengine/helloworld/pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Copyright 2015 Google Inc. All Rights Reserved.
2020
<packaging>war</packaging>
2121
<version>1.0-SNAPSHOT</version>
2222
<groupId>com.example.appengine</groupId>
23-
<artifactId>helloworld</artifactId>
23+
<artifactId>appengine-helloworld</artifactId>
2424
<dependencies>
2525
<dependency>
2626
<groupId>javax.servlet</groupId>
@@ -48,6 +48,20 @@ Copyright 2015 Google Inc. All Rights Reserved.
4848
<artifactId>appengine-maven-plugin</artifactId>
4949
<version>1.9.31</version>
5050
</plugin>
51+
<plugin>
52+
<groupId>org.apache.maven.plugins</groupId>
53+
<artifactId>maven-checkstyle-plugin</artifactId>
54+
<version>2.17</version>
55+
<configuration>
56+
<configLocation>../../google-checks.xml</configLocation>
57+
<consoleOutput>true</consoleOutput>
58+
<failOnViolation>true</failOnViolation>
59+
<failsOnError>true</failsOnError>
60+
</configuration>
61+
<executions>
62+
<execution><goals><goal>check</goal></goals></execution>
63+
</executions>
64+
</plugin>
5165
</plugins>
5266
</build>
5367
</project>

appengine/mailgun/pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<packaging>war</packaging>
66
<version>1.0-SNAPSHOT</version>
77
<groupId>com.example.managedvms</groupId>
8-
<artifactId>mailgun</artifactId>
8+
<artifactId>appengine-mailgun</artifactId>
99
<dependencies>
1010
<dependency>
1111
<groupId>javax.servlet</groupId>
@@ -58,6 +58,20 @@
5858
<artifactId>gcloud-maven-plugin</artifactId>
5959
<version>2.0.9.90.v20151210</version>
6060
</plugin>
61+
<plugin>
62+
<groupId>org.apache.maven.plugins</groupId>
63+
<artifactId>maven-checkstyle-plugin</artifactId>
64+
<version>2.17</version>
65+
<configuration>
66+
<configLocation>../../google-checks.xml</configLocation>
67+
<consoleOutput>true</consoleOutput>
68+
<failOnViolation>true</failOnViolation>
69+
<failsOnError>true</failsOnError>
70+
</configuration>
71+
<executions>
72+
<execution><goals><goal>check</goal></goals></execution>
73+
</executions>
74+
</plugin>
6175
</plugins>
6276
</build>
6377
</project>

appengine/memcache/pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<packaging>war</packaging>
66
<version>1.0-SNAPSHOT</version>
77
<groupId>com.example.managedvms</groupId>
8-
<artifactId>memcache</artifactId>
8+
<artifactId>appengine-memcache</artifactId>
99
<dependencies>
1010
<dependency>
1111
<groupId>javax.servlet</groupId>
@@ -46,6 +46,20 @@
4646
<artifactId>gcloud-maven-plugin</artifactId>
4747
<version>2.0.9.90.v20151210</version>
4848
</plugin>
49+
<plugin>
50+
<groupId>org.apache.maven.plugins</groupId>
51+
<artifactId>maven-checkstyle-plugin</artifactId>
52+
<version>2.17</version>
53+
<configuration>
54+
<configLocation>../../google-checks.xml</configLocation>
55+
<consoleOutput>true</consoleOutput>
56+
<failOnViolation>true</failOnViolation>
57+
<failsOnError>true</failsOnError>
58+
</configuration>
59+
<executions>
60+
<execution><goals><goal>check</goal></goals></execution>
61+
</executions>
62+
</plugin>
4963
</plugins>
5064
</build>
5165
</project>

appengine/sendgrid/pom.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<packaging>war</packaging>
66
<version>1.0-SNAPSHOT</version>
77
<groupId>com.example.managedvms</groupId>
8-
<artifactId>sendgrid</artifactId>
8+
<artifactId>appengine-sendgrid</artifactId>
99
<dependencies>
1010
<dependency>
1111
<groupId>javax.servlet</groupId>
@@ -48,6 +48,24 @@
4848
<artifactId>gcloud-maven-plugin</artifactId>
4949
<version>2.0.9.90.v20151210</version>
5050
</plugin>
51+
<!--
52+
The sendgrid sample currently (2016-01-22) fails the Google Style
53+
checks. We can uncomment this block when it is fixed.
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-checkstyle-plugin</artifactId>
57+
<version>2.17</version>
58+
<configuration>
59+
<configLocation>../../google-checks.xml</configLocation>
60+
<consoleOutput>true</consoleOutput>
61+
<failOnViolation>true</failOnViolation>
62+
<failsOnError>true</failsOnError>
63+
</configuration>
64+
<executions>
65+
<execution><goals><goal>check</goal></goals></execution>
66+
</executions>
67+
</plugin>
68+
-->
5169
</plugins>
5270
</build>
5371
</project>

0 commit comments

Comments
 (0)