From 6a27eff6771dfe2c933546e23dff465b631ccc88 Mon Sep 17 00:00:00 2001 From: Dean Wette Date: Thu, 27 Oct 2022 12:04:42 -0500 Subject: [PATCH] ci: build to 6.0.1, test to 4.0.0-SNAPSHOT, groovy to 4.0.6, spock to 2.3-groovy-4.0, github workflows to Java 17 (#353) * ci: build to 6.0.1, test to 4.0.0-SNAPSHOT, groovy to 4.0.6, spock to 2.3-groovy-4.0, github workflows to Java 17, fixes for core breaking changes * github workflows to Java 17, fix for core breaking changes --- .github/workflows/central-sync.yml | 2 +- .github/workflows/graalvm.yml | 2 +- .github/workflows/gradle.yml | 6 +-- .github/workflows/publish-snapshot.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/sonarqube.yml | 2 +- build.gradle | 1 - buildSrc/build.gradle | 5 +++ buildSrc/settings.gradle | 7 ++++ ...cronaut.build.internal.servlet-base.gradle | 16 ++++++++ config/accepted-api-changes.json | 20 ++++++++++ gradle.properties | 8 ++-- gradle/libs.versions.toml | 21 +---------- http-server-jetty/build.gradle | 22 +++++------ http-server-tomcat/build.gradle | 18 ++++----- http-server-undertow/build.gradle | 16 ++++---- servlet-core/build.gradle | 12 +++--- .../servlet/http/ServletResponseFactory.java | 36 +++++++----------- servlet-engine/build.gradle | 10 ++--- .../servlet/engine/DefaultServletCookies.java | 1 - .../engine/DefaultServletHttpResponse.java | 37 ++++++++++--------- settings.gradle | 16 +++++++- test-suite-kotlin-jetty/build.gradle | 18 ++++----- 23 files changed, 155 insertions(+), 125 deletions(-) create mode 100644 buildSrc/settings.gradle diff --git a/.github/workflows/central-sync.yml b/.github/workflows/central-sync.yml index 3d550abb3..add5cc43d 100644 --- a/.github/workflows/central-sync.yml +++ b/.github/workflows/central-sync.yml @@ -23,7 +23,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'adopt' - java-version: '11' + java-version: '17' - name: Publish to Sonatype OSSRH env: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index 2fa66fa3e..b7278470f 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: ['11', '17'] + java: ['17'] graalvm: ['latest', 'dev'] steps: # https://github.com/actions/virtual-environments/issues/709 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index e1e63f97d..1e37c151e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: ['8', '11', '17'] + java: ['17'] steps: # https://github.com/actions/virtual-environments/issues/709 - name: Free disk space @@ -72,7 +72,7 @@ jobs: name: binary-compatibility-reports path: "**/build/reports/binary-compatibility-*.html" - name: Publish to Sonatype Snapshots - if: success() && github.event_name == 'push' && matrix.java == '11' + if: success() && github.event_name == 'push' && matrix.java == '17' env: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} @@ -88,7 +88,7 @@ jobs: if_true: "micronaut-projects/micronaut-docs" if_false: ${{ github.repository }} - name: Publish to Github Pages - if: success() && github.event_name == 'push' && matrix.java == '11' + if: success() && github.event_name == 'push' && matrix.java == '17' uses: micronaut-projects/github-pages-deploy-action@master env: TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }} diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index 8b70c7e48..5c8bd2933 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -21,7 +21,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'adopt' - java-version: '11' + java-version: '17' - name: Publish to Sonatype Snapshots if: success() env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 13dcbbcad..8d9336034 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'adopt' - java-version: '11' + java-version: '17' - name: Set the current release version id: release_version run: echo ::set-output name=release_version::${GITHUB_REF:11} diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 93ae8a949..4ed20609f 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -38,7 +38,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'adopt' - java-version: 11 + java-version: 17 - name: Optional setup step env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} diff --git a/build.gradle b/build.gradle index f7a131989..5ea08f11f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,5 @@ plugins { id "io.micronaut.build.internal.docs" - id "io.micronaut.build.internal.dependency-updates" id "io.micronaut.build.internal.quality-reporting" } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 678405245..d358d40f6 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -1,3 +1,8 @@ plugins { id 'groovy-gradle-plugin' } + +repositories { + gradlePluginPortal() + mavenCentral() +} diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle new file mode 100644 index 000000000..6f31e6ef7 --- /dev/null +++ b/buildSrc/settings.gradle @@ -0,0 +1,7 @@ +dependencyResolutionManagement { + versionCatalogs { + libs { + from(files("../gradle/libs.versions.toml")) + } + } +} diff --git a/buildSrc/src/main/groovy/io.micronaut.build.internal.servlet-base.gradle b/buildSrc/src/main/groovy/io.micronaut.build.internal.servlet-base.gradle index 29ad2bbf4..c899fd236 100644 --- a/buildSrc/src/main/groovy/io.micronaut.build.internal.servlet-base.gradle +++ b/buildSrc/src/main/groovy/io.micronaut.build.internal.servlet-base.gradle @@ -1,4 +1,20 @@ +plugins { + id 'java' +} + repositories { mavenCentral() maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" } } + +configurations.all { + resolutionStrategy.dependencySubstitution { + substitute(module("org.codehaus.groovy:groovy")) + .using(module("org.apache.groovy:groovy:4.0.6")) + } +} + +dependencies { + testRuntimeOnly mn.snakeyaml +} + diff --git a/config/accepted-api-changes.json b/config/accepted-api-changes.json index 79b84c769..98ef18e47 100644 --- a/config/accepted-api-changes.json +++ b/config/accepted-api-changes.json @@ -33,6 +33,26 @@ "type": "io.micronaut.servlet.http.ServletCookies", "member": "Constructor io.micronaut.servlet.http.ServletCookies(java.lang.String,io.micronaut.http.HttpHeaders,io.micronaut.core.convert.ConversionService)", "reason": "removed deprecated class for Micronaut 4.0.x" + }, + { + "type": "io.micronaut.servlet.http.ServletCookies", + "member": "Implemented interface io.micronaut.core.convert.value.ConvertibleValues", + "reason": "removed deprecated class for Micronaut 4.0.x" + }, + { + "type": "io.micronaut.servlet.http.ServletCookies", + "member": "Implemented interface io.micronaut.core.value.ValueResolver", + "reason": "removed deprecated class for Micronaut 4.0.x" + }, + { + "type": "io.micronaut.servlet.http.ServletCookies", + "member": "Implemented interface java.lang.Iterable", + "reason": "removed deprecated class for Micronaut 4.0.x" + }, + { + "type": "io.micronaut.servlet.http.ServletCookies", + "member": "Implemented interface io.micronaut.http.cookie.Cookies", + "reason": "removed deprecated class for Micronaut 4.0.x" } ] diff --git a/gradle.properties b/gradle.properties index 06eb39c35..5bdebebfe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,11 +4,11 @@ projectGroup=io.micronaut.servlet micronautDocsVersion=2.0.0 micronautVersion=4.0.0-SNAPSHOT -micronautTestVersion=3.4.0 +micronautTestVersion=4.0.0-SNAPSHOT -groovyVersion=3.0.12 -spockVersion=2.1-groovy-3.0 -kotlinVersion=1.6.10 +groovyVersion=4.0.6 +spockVersion=2.3-groovy-4.0 +kotlinVersion=1.7.20 title=Micronaut Servlet projectDesc=Provides integration between Micronaut and the Servlet API diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ae40a0263..3b571d8ae 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,28 +7,10 @@ kotest-runner = '5.4.1' undertow = '2.2.18.Final' jetty = '9.4.48.v20220622' tomcat = '9.0.65' -google-cloud-functions = '1.0.4' [libraries] managed-servlet-api = { module = 'javax.servlet:javax.servlet-api', version.ref = 'managed-servlet-api' } -micronaut-graal = { module = 'io.micronaut:micronaut-graal' } -micronaut-http-server = { module = 'io.micronaut:micronaut-http-server' } -micronaut-http-netty = { module = 'io.micronaut:micronaut-http-netty' } -micronaut-inject = { module = 'io.micronaut:micronaut-inject' } -micronaut-inject-java = { module = 'io.micronaut:micronaut-inject-java' } -micronaut-management = { module = 'io.micronaut:micronaut-management' } -micronaut-kotest = { module = 'io.micronaut.test:micronaut-test-kotest' } -micronaut-session = { module = 'io.micronaut:micronaut-session' } -micronaut-http-client = { module = 'io.micronaut:micronaut-http-client' } -micronaut-reactor = { module = 'io.micronaut.reactor:micronaut-reactor' } -micronaut-router = { module = 'io.micronaut:micronaut-router' } -micronaut-security = { module = 'io.micronaut.security:micronaut-security' } -micronaut-reactor-http-client = { module = 'io.micronaut.reactor:micronaut-reactor-http-client' } - -groovy-json = { module = 'org.codehaus.groovy:groovy-json' } -graal = { module = "org.graalvm.nativeimage:svm" } -projectreactor = { module = 'io.projectreactor:reactor-core' } junit-jupiter-engine = { module = 'org.junit.jupiter:junit-jupiter-engine' } kotlin-stdlib-jdk8 = { module = 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' } kotlin-reflect = { module = 'org.jetbrains.kotlin:kotlin-reflect' } @@ -40,5 +22,4 @@ kotlinx-coroutines-rx2 = { module = 'org.jetbrains.kotlinx:kotlinx-coroutines-rx tomcat-embed-core = { module = 'org.apache.tomcat.embed:tomcat-embed-core', version.ref = 'tomcat' } undertow-servlet = { module = 'io.undertow:undertow-servlet', version.ref = 'undertow' } jetty = { module = 'org.eclipse.jetty:jetty-servlet', version.ref = 'jetty' } -google-cloud-functions = { module = 'com.google.cloud.functions:functions-framework-api', version.ref = 'google-cloud-functions' } -kotest-runner = { module = 'io.kotest:kotest-runner-junit5', version.ref = 'kotest-runner' } \ No newline at end of file +kotest-runner = { module = 'io.kotest:kotest-runner-junit5', version.ref = 'kotest-runner' } diff --git a/http-server-jetty/build.gradle b/http-server-jetty/build.gradle index c3cffcbfe..e9137200a 100644 --- a/http-server-jetty/build.gradle +++ b/http-server-jetty/build.gradle @@ -3,20 +3,20 @@ plugins { } dependencies { - annotationProcessor libs.micronaut.graal + annotationProcessor mn.micronaut.graal - api project(":servlet-engine") - api libs.micronaut.http.server + api projects.servletEngine + api mn.micronaut.http.server implementation(libs.jetty) - testAnnotationProcessor libs.micronaut.inject.java - testImplementation libs.micronaut.management - testImplementation libs.micronaut.http.client - testImplementation libs.micronaut.session - testImplementation(libs.groovy.json) - testImplementation libs.micronaut.reactor - testImplementation libs.micronaut.reactor.http.client + testAnnotationProcessor mn.micronaut.inject.java + testImplementation mn.micronaut.management + testImplementation mn.micronaut.http.client + testImplementation mn.micronaut.session + testImplementation(mn.groovy.json) + testImplementation mn.micronaut.reactor + testImplementation mn.micronaut.reactor.http.client - testImplementation(libs.micronaut.security) + testImplementation(mn.micronaut.security) } diff --git a/http-server-tomcat/build.gradle b/http-server-tomcat/build.gradle index 598dfb179..707387bb5 100644 --- a/http-server-tomcat/build.gradle +++ b/http-server-tomcat/build.gradle @@ -3,19 +3,19 @@ plugins { } dependencies { - annotationProcessor libs.micronaut.graal + annotationProcessor mn.micronaut.graal - api project(":servlet-engine") - api libs.micronaut.http.server + api projects.servletEngine + api mn.micronaut.http.server - compileOnly libs.graal + compileOnly mn.graal implementation libs.tomcat.embed.core - testAnnotationProcessor libs.micronaut.inject.java - testImplementation libs.micronaut.session - testImplementation libs.micronaut.http.client - testImplementation libs.projectreactor - testImplementation libs.micronaut.security + testAnnotationProcessor mn.micronaut.inject.java + testImplementation mn.micronaut.session + testImplementation mn.micronaut.http.client + testImplementation mn.reactor + testImplementation mn.micronaut.security } diff --git a/http-server-undertow/build.gradle b/http-server-undertow/build.gradle index 307725dd8..5104fade7 100644 --- a/http-server-undertow/build.gradle +++ b/http-server-undertow/build.gradle @@ -3,16 +3,16 @@ plugins { } dependencies { - annotationProcessor libs.micronaut.graal + annotationProcessor mn.micronaut.graal - api project(":servlet-engine") - api libs.micronaut.http.server + api projects.servletEngine + api mn.micronaut.http.server implementation libs.undertow.servlet - testAnnotationProcessor libs.micronaut.inject.java - testImplementation libs.micronaut.http.client - testImplementation libs.micronaut.session - testImplementation libs.projectreactor - testImplementation libs.micronaut.security + testAnnotationProcessor mn.micronaut.inject.java + testImplementation mn.micronaut.http.client + testImplementation mn.micronaut.session + testImplementation mn.reactor + testImplementation mn.micronaut.security } diff --git a/servlet-core/build.gradle b/servlet-core/build.gradle index a19610c3a..1e7d0d8c6 100644 --- a/servlet-core/build.gradle +++ b/servlet-core/build.gradle @@ -3,12 +3,12 @@ plugins { } dependencies { - api libs.micronaut.inject - api libs.micronaut.http.server + api mn.micronaut.inject + api mn.micronaut.http.server - implementation libs.micronaut.http.netty - implementation libs.micronaut.router - implementation libs.projectreactor + implementation mn.micronaut.http.netty + implementation mn.micronaut.router + implementation mn.reactor - testAnnotationProcessor libs.micronaut.inject.java + testAnnotationProcessor mn.micronaut.inject.java } diff --git a/servlet-core/src/main/java/io/micronaut/servlet/http/ServletResponseFactory.java b/servlet-core/src/main/java/io/micronaut/servlet/http/ServletResponseFactory.java index 098bedeec..1989513f2 100644 --- a/servlet-core/src/main/java/io/micronaut/servlet/http/ServletResponseFactory.java +++ b/servlet-core/src/main/java/io/micronaut/servlet/http/ServletResponseFactory.java @@ -22,9 +22,10 @@ import io.micronaut.http.HttpStatus; import io.micronaut.http.MutableHttpResponse; import io.micronaut.http.context.ServerRequestContext; -import io.micronaut.http.server.exceptions.InternalServerException; import io.micronaut.http.simple.SimpleHttpResponseFactory; +import java.util.Objects; + /** * An implementation of the {@link HttpResponseFactory} case that retrieves the * response object from the current request bound to the current thread. @@ -45,11 +46,7 @@ public class ServletResponseFactory implements HttpResponseFactory { } } - if (alternate != null) { - ALTERNATE = alternate; - } else { - ALTERNATE = new SimpleHttpResponseFactory(); - } + ALTERNATE = Objects.requireNonNullElseGet(alternate, SimpleHttpResponseFactory::new); } @SuppressWarnings("unchecked") @@ -60,27 +57,24 @@ public MutableHttpResponse ok(T body) { final MutableHttpResponse response = ((ServletExchange) req).getResponse(); return response.status(HttpStatus.OK).body(body); } else { - if (ALTERNATE != null) { - return ALTERNATE.ok(body); - } else { - throw new InternalServerException("No request present"); - } + return ALTERNATE.ok(body); } } @SuppressWarnings("unchecked") @Override public MutableHttpResponse status(HttpStatus status, String reason) { + return status(status.getCode(), reason); + } + + @Override + public MutableHttpResponse status(int status, String reason) { final HttpRequest req = ServerRequestContext.currentRequest().orElse(null); if (req instanceof ServletExchange) { - final MutableHttpResponse response = ((ServletExchange) req).getResponse(); + final MutableHttpResponse response = ((ServletExchange) req).getResponse(); return response.status(status, reason); } else { - if (ALTERNATE != null) { - return ALTERNATE.status(status, reason); - } else { - throw new InternalServerException("No request present"); - } + return ALTERNATE.status(status, reason); } } @@ -89,14 +83,10 @@ public MutableHttpResponse status(HttpStatus status, String reason) { public MutableHttpResponse status(HttpStatus status, T body) { final HttpRequest req = ServerRequestContext.currentRequest().orElse(null); if (req instanceof ServletExchange) { - final MutableHttpResponse response = ((ServletExchange) req).getResponse(); + final MutableHttpResponse response = ((ServletExchange) req).getResponse(); return response.status(status).body(body); } else { - if (ALTERNATE != null) { - return ALTERNATE.status(status, body); - } else { - throw new InternalServerException("No request present"); - } + return ALTERNATE.status(status, body); } } } diff --git a/servlet-engine/build.gradle b/servlet-engine/build.gradle index 88b9eeb13..ec2bf8608 100644 --- a/servlet-engine/build.gradle +++ b/servlet-engine/build.gradle @@ -3,13 +3,13 @@ plugins { } dependencies { - annotationProcessor libs.micronaut.graal + annotationProcessor mn.micronaut.graal - api project(":servlet-core") + api projects.servletCore api libs.managed.servlet.api - implementation libs.projectreactor + implementation mn.reactor - testAnnotationProcessor libs.micronaut.inject.java - testImplementation libs.google.cloud.functions + testAnnotationProcessor mn.micronaut.inject.java + testImplementation mn.google.function.framework } diff --git a/servlet-engine/src/main/java/io/micronaut/servlet/engine/DefaultServletCookies.java b/servlet-engine/src/main/java/io/micronaut/servlet/engine/DefaultServletCookies.java index 656d0780c..62eade6cf 100644 --- a/servlet-engine/src/main/java/io/micronaut/servlet/engine/DefaultServletCookies.java +++ b/servlet-engine/src/main/java/io/micronaut/servlet/engine/DefaultServletCookies.java @@ -75,7 +75,6 @@ public Collection values() { return getAll(); } - @Override public Optional get(CharSequence name, Class requiredType) { if (requiredType == Cookie.class || requiredType == Object.class) { diff --git a/servlet-engine/src/main/java/io/micronaut/servlet/engine/DefaultServletHttpResponse.java b/servlet-engine/src/main/java/io/micronaut/servlet/engine/DefaultServletHttpResponse.java index b30213a6e..035ae76df 100644 --- a/servlet-engine/src/main/java/io/micronaut/servlet/engine/DefaultServletHttpResponse.java +++ b/servlet-engine/src/main/java/io/micronaut/servlet/engine/DefaultServletHttpResponse.java @@ -73,6 +73,8 @@ public class DefaultServletHttpResponse implements ServletHttpResponse request; private final ServletResponseHeaders headers; private B body; + private int status = HttpStatus.OK.getCode(); + private String reason = HttpStatus.OK.getReason(); /** * Default constructor. @@ -257,15 +259,7 @@ public MutableHttpResponse header(CharSequence name, CharSequence value) { @Override public MutableHttpResponse status(int status) { - delegate.setStatus(status); - return this; - } - - @Override - public MutableHttpResponse status(int status, CharSequence message) { - if (message == null) { - return status(status); - } + this.status = status; delegate.setStatus(status); return this; } @@ -359,25 +353,34 @@ public MutableHttpResponse body(@Nullable T body) { } @Override - public MutableHttpResponse status(HttpStatus status, CharSequence message) { - Objects.requireNonNull(status, "Status cannot be null"); + public MutableHttpResponse status(int status, CharSequence message) { + this.status = status; + if (message == null) { + this.reason = HttpStatus.getDefaultReason(status); + } else { + this.reason = message.toString(); + } if (message != null) { try { - delegate.sendError(status.getCode(), message.toString()); + delegate.sendError(status, reason); } catch (IOException e) { throw new InternalServerException("Error sending error code: " + e.getMessage(), e); } } else { - delegate.setStatus(status.getCode()); + delegate.setStatus(status); } return this; } + + @Override + public int code() { + return status; + } + @Override - public HttpStatus getStatus() { - return HttpStatus.valueOf( - delegate.getStatus() - ); + public String reason() { + return reason; } /** diff --git a/settings.gradle b/settings.gradle index 06b0a3bd9..6ca82bade 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,9 +6,11 @@ pluginManagement { } plugins { - id 'io.micronaut.build.shared.settings' version '5.3.14' + id 'io.micronaut.build.shared.settings' version '6.0.1' } +enableFeaturePreview 'TYPESAFE_PROJECT_ACCESSORS' + rootProject.name = 'servlet-parent' include 'servlet-bom' @@ -20,3 +22,15 @@ include 'http-server-tomcat' include 'test-suite-kotlin-jetty' +dependencyResolutionManagement { + repositories { + mavenCentral() + maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" } + } +} + +micronautBuild { + importMicronautCatalog() +} + + diff --git a/test-suite-kotlin-jetty/build.gradle b/test-suite-kotlin-jetty/build.gradle index de5e9d322..9da6113da 100644 --- a/test-suite-kotlin-jetty/build.gradle +++ b/test-suite-kotlin-jetty/build.gradle @@ -7,7 +7,7 @@ plugins { dependencies { kaptTest platform("io.micronaut:micronaut-bom:$micronautVersion") testImplementation platform("io.micronaut:micronaut-bom:$micronautVersion") - kaptTest libs.micronaut.inject.java + kaptTest mn.micronaut.inject.java testRuntimeOnly libs.junit.jupiter.engine @@ -17,12 +17,13 @@ dependencies { testImplementation libs.kotlinx.coroutines.jdk8 testImplementation libs.kotlinx.coroutines.rx2 - testImplementation libs.micronaut.http.client - testImplementation libs.projectreactor - testImplementation libs.micronaut.kotest + testImplementation mn.micronaut.http.client + testImplementation mn.reactor + testImplementation mn.micronaut.test.kotest5 testImplementation libs.kotest.runner - testImplementation project(":http-server-jetty") + testImplementation projects.httpServerJetty + } tasks.named('test') { @@ -31,12 +32,7 @@ tasks.named('test') { compileTestKotlin { kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '17' javaParameters = true } } - -java { - sourceCompatibility = JavaVersion.toVersion("1.8") - targetCompatibility = JavaVersion.toVersion("1.8") -}