BAEL-1226 Checkstyle introduction. (#3736)

* BAEL-1226:- Changes for checkstyle

* BAEL-1226: Changes for checkstyle

* Changes for BAEL-1226:- Chnaged the file to match in article.

* Formatting chnages.

* BAEL-1226: Change for the pom
This commit is contained in:
Shreyash 2018-03-20 21:10:03 +05:30 committed by Grzegorz Piwowarek
parent 86a03336f4
commit e87a37911f
4 changed files with 54 additions and 5 deletions

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="AvoidStarImport">
<property name="severity" value="warning" />
</module>
</module>
</module>

View File

@ -220,6 +220,22 @@
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle-maven-plugin.version}</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
@ -311,6 +327,19 @@
</profiles> </profiles>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle-maven-plugin.version}</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
</configuration>
</plugin>
</plugins>
</reporting>
<properties> <properties>
<commons-fileupload.version>1.3.2</commons-fileupload.version> <commons-fileupload.version>1.3.2</commons-fileupload.version>
<kryo.version>4.0.0</kryo.version> <kryo.version>4.0.0</kryo.version>
@ -325,7 +354,8 @@
<!-- Maven plugins --> <!-- Maven plugins -->
<cargo-maven2-plugin.version>1.6.0</cargo-maven2-plugin.version> <cargo-maven2-plugin.version>1.6.0</cargo-maven2-plugin.version>
<findbugs-maven-plugin.version>3.0.4</findbugs-maven-plugin.version> <findbugs-maven-plugin.version>3.0.4</findbugs-maven-plugin.version>
<checkstyle-maven-plugin.version>3.0.0</checkstyle-maven-plugin.version>
<dependency.locations.enabled>false</dependency.locations.enabled>
<!-- okhttp --> <!-- okhttp -->
<com.squareup.okhttp3.version>3.4.1</com.squareup.okhttp3.version> <com.squareup.okhttp3.version>3.4.1</com.squareup.okhttp3.version>

View File

@ -1,14 +1,18 @@
package org.baeldung.web.controller; package org.baeldung.web.controller;
import java.util.Map;
import org.baeldung.repository.HeavyResourceRepository; import org.baeldung.repository.HeavyResourceRepository;
import org.baeldung.web.dto.HeavyResource; import org.baeldung.web.dto.HeavyResource;
import org.baeldung.web.dto.HeavyResourceAddressOnly; import org.baeldung.web.dto.HeavyResourceAddressOnly;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.Map; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
public class HeavyResourceController { public class HeavyResourceController {

View File

@ -2,7 +2,11 @@ package org.baeldung.web.controller.mediatypes;
import org.baeldung.web.dto.BaeldungItem; import org.baeldung.web.dto.BaeldungItem;
import org.baeldung.web.dto.BaeldungItemV2; import org.baeldung.web.dto.BaeldungItemV2;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping(value = "/", produces = "application/vnd.baeldung.api.v1+json") @RequestMapping(value = "/", produces = "application/vnd.baeldung.api.v1+json")