Skip to content

Commit bcd5a49

Browse files
Sebastian JustSebastian Just
authored andcommitted
Added checkstyle with deprecated methods
Marked deprecated functions of the DynamoDB SDK in checkstyle. Also updated Cobertura configuration
1 parent 7b01f3d commit bcd5a49

File tree

2 files changed

+108
-14
lines changed

2 files changed

+108
-14
lines changed

checkstyle.xml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4+
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
5+
<module name="Checker">
6+
<!--
7+
<module name="RegexpSingleline">-->
8+
<!-- \s matches whitespace character, $ matches end of line. --><!--
9+
<property name="format" value="\s+$" />
10+
</module>
11+
<module name="FileTabCharacter">
12+
<property name="eachLine" value="true" />
13+
</module>
14+
-->
15+
<module name="TreeWalker">
16+
<module name="ModifierOrder" />
17+
<module name="EmptyBlock" />
18+
<module name="AvoidStarImport" />
19+
<module name="UnusedImports" />
20+
<!--
21+
<module name="ImportOrder">
22+
<property name="ordered" value="true" />
23+
<property name="separated" value="true" />
24+
<property name="option" value="top" />
25+
<property name="sortStaticImportsAlphabetically"
26+
value="true" />
27+
</module>
28+
-->
29+
<module name="RegexpSinglelineJava">
30+
<property name="format" value="System\.out(?:\.|::)println"/>
31+
</module>
32+
<module name="RegexpSinglelineJava">
33+
<property name="format" value="System\.err(?:\.|::)println"/>
34+
</module>
35+
<module name="RegexpSinglelineJava">
36+
<property name="format" value="\.printStackTrace"/>
37+
</module>
38+
<!-- Deprecated DynamoDB paramters -->
39+
<module name="RegexpSinglelineJava">
40+
<property name="format" value="setKeyConditions"/>
41+
</module>
42+
<module name="RegexpSinglelineJava">
43+
<property name="format" value="withKeyConditions"/>
44+
</module>
45+
<module name="RegexpSinglelineJava">
46+
<property name="format" value="setQueryFilter"/>
47+
</module>
48+
<module name="RegexpSinglelineJava">
49+
<property name="format" value="withQueryFilter"/>
50+
</module>
51+
<module name="RegexpSinglelineJava">
52+
<property name="format" value="setScanFilter"/>
53+
</module>
54+
<module name="RegexpSinglelineJava">
55+
<property name="format" value="withScanFilter"/>
56+
</module>
57+
58+
</module>
59+
</module>

pom.xml

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@
2121
<hibernate-validator.version>5.2.2.Final</hibernate-validator.version>
2222
<aws-java-sdk.version>1.10.39</aws-java-sdk.version>
2323
<mockito.version>1.10.19</mockito.version>
24+
<maven.cobertura.plugin.version>2.7</maven.cobertura.plugin.version>
2425

2526
<cdi>1.2</cdi>
2627
<commons.lang>3.4</commons.lang>
2728

2829
<maven.compiler.source>1.7</maven.compiler.source>
2930
<maven.compiler.target>1.7</maven.compiler.target>
31+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
32+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
3033
</properties>
3134

3235
<dependencyManagement>
@@ -134,11 +137,49 @@
134137
</dependencies>
135138

136139
<build>
137-
<pluginManagement>
138-
<plugins>
139-
</plugins>
140-
</pluginManagement>
141140
<plugins>
141+
<plugin>
142+
<groupId>org.codehaus.mojo</groupId>
143+
<artifactId>cobertura-maven-plugin</artifactId>
144+
<version>${maven.cobertura.plugin.version}</version>
145+
<configuration>
146+
<formats>
147+
<format>xml</format>
148+
<format>html</format>
149+
</formats>
150+
<check>
151+
<totalBranchRate>85</totalBranchRate>
152+
<totalLineRate>91</totalLineRate>
153+
<haltOnFailure>true</haltOnFailure>
154+
</check>
155+
</configuration>
156+
</plugin>
157+
<plugin>
158+
<groupId>org.apache.maven.plugins</groupId>
159+
<artifactId>maven-checkstyle-plugin</artifactId>
160+
<version>2.15</version>
161+
<dependencies>
162+
<dependency>
163+
<groupId>com.puppycrawl.tools</groupId>
164+
<artifactId>checkstyle</artifactId>
165+
<version>6.6</version>
166+
</dependency>
167+
</dependencies>
168+
<executions>
169+
<execution>
170+
<id>verify-style</id>
171+
<phase>process-resources</phase>
172+
<goals>
173+
<goal>check</goal>
174+
</goals>
175+
</execution>
176+
</executions>
177+
<configuration>
178+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
179+
<logViolationsToConsole>true</logViolationsToConsole>
180+
<configLocation>checkstyle.xml</configLocation>
181+
</configuration>
182+
</plugin>
142183
<plugin>
143184
<groupId>org.apache.maven.plugins</groupId>
144185
<artifactId>maven-release-plugin</artifactId>
@@ -210,11 +251,6 @@
210251
</execution>
211252
</executions>
212253
</plugin>
213-
<plugin>
214-
<groupId>org.codehaus.mojo</groupId>
215-
<artifactId>cobertura-maven-plugin</artifactId>
216-
<version>2.5.1</version>
217-
</plugin>
218254

219255
<plugin>
220256
<groupId>org.apache.maven.plugins</groupId>
@@ -228,11 +264,10 @@
228264
</build>
229265

230266
<scm>
231-
<url>https://github.com/michaellavelle/spring-data-dynamodb</url>
232-
<connection>scm:git:ssh://github.com/michaellavelle/spring-data-dynamodb.git</connection>
233-
<developerConnection>scm:git:ssh://git@github.com/michaellavelle/spring-data-dynamodb.git</developerConnection>
234-
<tag>spring-data-dynamodb-1.0.5</tag>
235-
</scm>
267+
<url>https://github.com/derjust/spring-data-dynamodb</url>
268+
<connection>scm:git:ssh://github.com/derjust/spring-data-dynamodb.git</connection>
269+
<developerConnection>scm:git:ssh://git@github.com/derjust/spring-data-dynamodb.git</developerConnection>
270+
</scm>
236271

237272
<repositories>
238273
<repository>

0 commit comments

Comments
 (0)