Skip to content

Commit

Permalink
Merge branch 'release/v1.6.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarman committed Aug 11, 2016
2 parents 9d12b47 + 4408368 commit 9c59780
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 68 deletions.
20 changes: 13 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
}

dependencies {
classpath group: 'org.springframework.boot', name: 'spring-boot-gradle-plugin', version: '1.3.6.RELEASE'
classpath group: 'org.springframework.boot', name: 'spring-boot-gradle-plugin', version: '1.4.0.RELEASE'
}
}

Expand All @@ -18,16 +18,17 @@ apply plugin: 'project-report'
apply plugin: 'build-dashboard'

ext {
jacocoVersion = '0.7.5.201505241946'
checkstyleVersion = '6.16.1'
pmdVersion = '5.4.1'
jacocoVersion = '0.7.7.201606060606'
checkstyleVersion = '7.1'
pmdVersion = '5.5.1'
guavaVersion = '19.0'
jadiraVersion = '4.0.0.GA'
swaggerVersion = '2.3.0'
jadiraVersion = '5.0.0.GA'
swaggerVersion = '2.5.0'
}

group = 'com.leanstacks'
version = '1.6.1'
sourceCompatibility = 1.8
version = '1.6.0'

repositories {
jcenter()
Expand All @@ -44,6 +45,7 @@ dependencies {
compile group: 'joda-time', name: 'joda-time'
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-joda'
compile group: 'com.google.guava', name: 'guava', version: guavaVersion
compile group: 'com.github.ben-manes.caffeine', name: 'caffeine'
compile group: 'org.jadira.usertype', name: 'usertype.extended', version: jadiraVersion
compile group: 'io.springfox', name: 'springfox-swagger2', version: swaggerVersion
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: swaggerVersion
Expand All @@ -68,6 +70,10 @@ task encodePassword(type: JavaExec) {
}
}

springBoot {
buildInfo()
}

jacoco {
toolVersion = jacocoVersion
}
Expand Down
5 changes: 4 additions & 1 deletion etc/pmd/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
<rule ref="rulesets/java/javabeans.xml" />

<!-- Use the entire 'java logging' ruleset -->
<rule ref="rulesets/java/logging-java.xml" />
<rule ref="rulesets/java/logging-java.xml">
<!-- InvalidSlf4jMessageFormat has bug in PMD 5.5.1 -->
<exclude name="InvalidSlf4jMessageFormat" />
</rule>

<!-- Use the entire 'junit' ruleset -->
<rule ref="rulesets/java/junit.xml" />
Expand Down
29 changes: 20 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@

<groupId>com.leanstacks</groupId>
<artifactId>skeleton-ws-spring-boot</artifactId>
<version>1.6.0</version>
<name>Web Services Project Skeleton</name>
<description>Skeleton project for RESTful web services using Spring Boot.</description>
<version>1.6.1</version>
<name>Web Services Stack</name>
<description>Starter application stack for RESTful web services using Spring Boot.</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.6.RELEASE</version>
<version>1.4.0.RELEASE</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<guava.version>19.0</guava.version>
<swagger.version>2.3.0</swagger.version>
<jadira.version>4.0.0.GA</jadira.version>
<jadira.version>5.0.0.GA</jadira.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -58,15 +58,14 @@
<version>${jadira.version}</version>
</dependency>

<!-- Dependencies for GuavaCacheManager -->
<!-- Dependencies for CacheManager -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>

<!-- Dependencies for Miscellaneous Functionality -->
Expand All @@ -78,6 +77,11 @@
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>

<!-- Dependencies for Swagger -->
<dependency>
Expand All @@ -104,6 +108,13 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
21 changes: 8 additions & 13 deletions src/main/java/com/leanstacks/ws/ApiDocsConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
* The ApiDocsConfiguration class provides configuration beans for the Swagger
* API documentation generator.
* The ApiDocsConfiguration class provides configuration beans for the Swagger API documentation generator.
*
* @author Matt Warman
*/
Expand All @@ -27,32 +26,28 @@ public class ApiDocsConfiguration {
/**
* The project version.
*/
public static final String PROJECT_VERSION = "1.6.0";
public static final String PROJECT_VERSION = "1.6.1";
/**
* The project contact information.
*/
public static final String PROJECT_CONTACT = "LeanStacks.com";

/**
* Create a Docket class to be used by Springfox's Swagger API Documentation
* framework. See http://springfox.github.io/springfox/ for more
* information.
* Create a Docket class to be used by Springfox's Swagger API Documentation framework. See
* http://springfox.github.io/springfox/ for more information.
*
* @return A Docket instance.
*/
@Bean
public Docket docket() {
final Predicate<String> paths = PathSelectors.ant("/api/**");

final ApiInfo apiInfo = new ApiInfoBuilder()
.title("Project Skeleton for Spring Boot Web Services")
.description(
"The Spring Boot web services starter project provides a foundation "
+ "to rapidly construct a RESTful web services application.")
final ApiInfo apiInfo = new ApiInfoBuilder().title("Project Skeleton for Spring Boot Web Services")
.description("The Spring Boot web services starter project provides a foundation "
+ "to rapidly construct a RESTful web services application.")
.contact(PROJECT_CONTACT).version(PROJECT_VERSION).build();

final Docket docket = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo).select().paths(paths).build();
final Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo).select().paths(paths).build();

return docket;
}
Expand Down
16 changes: 0 additions & 16 deletions src/main/java/com/leanstacks/ws/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.guava.GuavaCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
Expand Down Expand Up @@ -36,17 +33,4 @@ public static void main(final String... args) {
SpringApplication.run(Application.class, args);
}

/**
* Create a CacheManager implementation class to be used by Spring where <code>@Cacheable</code> annotations are
* applied.
*
* @return A CacheManager instance.
*/
@Bean
public CacheManager cacheManager() {
final GuavaCacheManager cacheManager = new GuavaCacheManager(CACHE_GREETINGS);

return cacheManager;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,12 @@ public ResponseEntity<Greeting> createGreeting(@RequestBody final Greeting greet
method = RequestMethod.PUT,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Greeting> updateGreeting(@RequestBody final Greeting greeting) {
public ResponseEntity<Greeting> updateGreeting(@PathVariable("id") final Long id,
@RequestBody final Greeting greeting) {
logger.info("> updateGreeting");

greeting.setId(id);

final Greeting updatedGreeting = greetingService.update(greeting);

logger.info("< updateGreeting");
Expand Down
18 changes: 9 additions & 9 deletions src/main/resources/config/application-mysql.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
# Data Source Configuration
##
#Connection
spring.datasource.url=jdbc:mysql://localhost/skeleton
spring.datasource.url=jdbc:mysql://localhost/skeleton?useSSL=false
spring.datasource.username=skeluser
spring.datasource.password=skelpass
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

# Pool
spring.datasource.max-active=50
spring.datasource.max-idle=5
spring.datasource.min-idle=5
spring.datasource.initial-size=10
spring.datasource.tomcat.max-active=50
spring.datasource.tomcat.max-idle=5
spring.datasource.tomcat.min-idle=5
spring.datasource.tomcat.initial-size=10

spring.datasource.validation-query=select 1;
spring.datasource.test-on-borrow=true
spring.datasource.tomcat.validation-query=select 1;
spring.datasource.tomcat.test-on-borrow=true

spring.datasource.time-between-eviction-runs-millis=60000
spring.datasource.min-evictable-idle-time-millis=300000
spring.datasource.tomcat.time-between-eviction-runs-millis=60000
spring.datasource.tomcat.min-evictable-idle-time-millis=300000

# Initialization
spring.datasource.schema=classpath:/data/mysql/schema.sql
Expand Down
16 changes: 8 additions & 8 deletions src/main/resources/config/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ spring.profiles.active=hsqldb,batch
##
# Web Server Configuration
##
server.port=
#server.port=

##
# Cache Configuration
##
spring.cache.cache-names=greetings
spring.cache.caffeine.spec=maximumSize=250,expireAfterAccess=600s

##
# Data Source Configuration
##

# Hibernate
spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.DefaultNamingStrategy
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.jpa.properties.jadira.usertype.autoRegisterUserTypes=true

##
# Actuator Configuration
##
management.context-path=/actuators

info.build.groupId=@project.groupId@
info.build.artifact=@project.artifactId@
info.build.name=@project.name@
info.build.description=@project.description@
info.build.version=@project.version@

##
# Logging Configuration
##
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/com/leanstacks/ws/AbstractTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import com.leanstacks.ws.util.RequestContext;

Expand All @@ -14,8 +14,8 @@
*
* @author Matt Warman
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public abstract class AbstractTest {

/**
Expand Down

0 comments on commit 9c59780

Please sign in to comment.