From db35dcd082929d6c06cdecc8dea2f58c6f2c4977 Mon Sep 17 00:00:00 2001 From: Niek Palm Date: Sun, 10 Mar 2019 17:34:47 +0100 Subject: [PATCH] Upgrade versions (#12) * Upgrade tools and frameworks * Upgrade to java11 and gradle 5 --- .travis.yml | 2 +- build.gradle | 18 ++++++++++++------ gradle.properties | 2 ++ gradle/dependencies.gradle | 18 +++++++++++------- gradle/jacoco.gradle | 3 +-- gradle/wrapper/gradle-wrapper.properties | 3 +-- .../resolvers/CommentPageableResponse.java | 2 ++ 7 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 gradle.properties diff --git a/.travis.yml b/.travis.yml index 1464c3f..efda351 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: java install: true jdk: -- oraclejdk8 +- openjdk11 before_script: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter diff --git a/build.gradle b/build.gradle index 35b7077..fc24240 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ buildscript { ext { - springBootVersion = '2.0.6.RELEASE' + springBootVersion = '2.1.3.RELEASE' } repositories { mavenLocal() @@ -11,6 +11,7 @@ buildscript { } } + apply plugin: 'java' apply plugin: 'idea' apply plugin: 'io.spring.dependency-management' @@ -20,8 +21,9 @@ apply plugin: 'project-report' apply from: "${rootDir}/gradle/dependencies.gradle" apply from: "${rootDir}/gradle/jacoco.gradle" -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +sourceCompatibility = JavaVersion.VERSION_11 +targetCompatibility = JavaVersion.VERSION_11 + repositories { mavenLocal() @@ -29,12 +31,16 @@ repositories { } dependencies { + annotationProcessor libraries.processors + compile libraries.springboot, libraries.tools, libraries.graphql, libraries.database testCompile libraries.test + + testAnnotationProcessor libraries.processors } // Enables passing command line options to bootRun (e.g ./gradlew -Dspring.profiles.active=development bootRun) @@ -42,6 +48,6 @@ bootRun { systemProperties System.properties } -task wrapper(type: Wrapper) { - gradleVersion = '4.9' -} +wrapper { + gradleVersion = '5.2.1' +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..f6dea19 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,2 @@ +## Currently required by graphql / spring combination +kotlin.version=1.3.10 diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index d1812e5..5aba575 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -8,24 +8,28 @@ libraries.springboot = [ libraries.tools = [ - 'org.projectlombok:lombok:1.18.2', - 'org.apache.commons:commons-lang3:3.7', - 'io.reactivex.rxjava2:rxjava:2.1.5', + 'org.projectlombok:lombok:1.18.6', + 'org.apache.commons:commons-lang3:3.8.1', + 'io.reactivex.rxjava2:rxjava:2.2.7', 'com.fasterxml.jackson.dataformat:jackson-dataformat-csv:', - 'com.google.guava:guava:26.0-jre' + 'com.google.guava:guava:27.1-jre' ] libraries.graphql = [ - 'com.graphql-java-kickstart:graphql-spring-boot-starter:5.0.5', - 'com.graphql-java-kickstart:graphiql-spring-boot-starter:5.0.5', - 'com.graphql-java-kickstart:graphql-java-tools:5.3.4' + 'com.graphql-java-kickstart:graphql-spring-boot-starter:5.7.0', + 'com.graphql-java-kickstart:graphiql-spring-boot-starter:5.7.0', + 'com.graphql-java-kickstart:graphql-java-tools:5.4.1' ] libraries.database = [ 'com.h2database:h2' ] +libraries.processors = [ + 'org.projectlombok:lombok:1.18.6' +] + libraries.test = [ 'org.mockito:mockito-core:2.21.0', 'org.springframework.boot:spring-boot-starter-test', diff --git a/gradle/jacoco.gradle b/gradle/jacoco.gradle index b959478..3fe40f8 100644 --- a/gradle/jacoco.gradle +++ b/gradle/jacoco.gradle @@ -1,7 +1,7 @@ apply plugin: "jacoco" jacoco { - toolVersion = findProperty("jacocoVersion") ?: "0.8.1" + toolVersion = findProperty("jacocoVersion") ?: "0.8.2" } jacocoTestReport { @@ -10,4 +10,3 @@ jacocoTestReport { html.enabled true } } - diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0f64538..44e7c4d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Wed Sep 12 17:40:13 CEST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip diff --git a/src/main/java/ofouro/code/graphql/demo/resolvers/CommentPageableResponse.java b/src/main/java/ofouro/code/graphql/demo/resolvers/CommentPageableResponse.java index 00f0b75..5ded2fb 100644 --- a/src/main/java/ofouro/code/graphql/demo/resolvers/CommentPageableResponse.java +++ b/src/main/java/ofouro/code/graphql/demo/resolvers/CommentPageableResponse.java @@ -1,12 +1,14 @@ package ofouro.code.graphql.demo.resolvers; import lombok.Data; +import lombok.EqualsAndHashCode; import ofouro.code.graphql.demo.model.Comment; import org.springframework.data.domain.Page; import java.util.List; @Data +@EqualsAndHashCode public class CommentPageableResponse extends PageableResponse { private List content;