From 58a45c53ac599588104dd82f9ddc81d73fd3f829 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 19 Mar 2020 13:33:57 +0100 Subject: [PATCH 1/3] Upgrade to Groovy 2.5.10 Closes gh-20575 --- spring-boot-project/spring-boot-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-dependencies/pom.xml b/spring-boot-project/spring-boot-dependencies/pom.xml index c0cd8b340a..3ed5ed1bfc 100644 --- a/spring-boot-project/spring-boot-dependencies/pom.xml +++ b/spring-boot-project/spring-boot-dependencies/pom.xml @@ -66,7 +66,7 @@ 6.8.6 3.0.3 2.3.2 - 2.5.9 + 2.5.10 2.8.6 1.4.200 2.1 From 579a6ac254995742ff2395b9a7c4dcc75b15774e Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 19 Mar 2020 14:14:10 +0100 Subject: [PATCH 2/3] Adapt tests for support for Java 14 See gh-20576 --- ...uchBeanDefinitionFailureAnalyzerTests.java | 13 ++++++++++--- .../spring-boot-gradle-plugin/pom.xml | 2 +- .../boot/loader/TestJarCreator.java | 3 ++- .../boot/system/JavaVersion.java | 10 ++++++++-- .../spring-boot-smoke-test-kafka/pom.xml | 19 +++++++++++++++++++ 5 files changed, 40 insertions(+), 7 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzerTests.java index bde0ae433a..0639878835 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +34,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.diagnostics.FailureAnalysis; import org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter; +import org.springframework.boot.system.JavaVersion; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; @@ -153,8 +154,14 @@ class NoSuchBeanDefinitionFailureAnalyzerTests { @Test void failureAnalysisForUnmatchedQualifier() { FailureAnalysis analysis = analyzeFailure(createFailure(QualifiedBeanConfiguration.class)); - assertThat(analysis.getDescription()) - .containsPattern("@org.springframework.beans.factory.annotation.Qualifier\\(value=\"*alpha\"*\\)"); + assertThat(analysis.getDescription()).containsPattern(determineAnnotationValuePattern()); + } + + private String determineAnnotationValuePattern() { + if (JavaVersion.getJavaVersion().isEqualOrNewerThan(JavaVersion.FOURTEEN)) { + return "@org.springframework.beans.factory.annotation.Qualifier\\(\"*alpha\"*\\)"; + } + return "@org.springframework.beans.factory.annotation.Qualifier\\(value=\"*alpha\"*\\)"; } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/pom.xml index 94a48efafa..248c2b71c3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/pom.xml @@ -389,7 +389,7 @@ java13 - 13 + [13,) assemble diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/TestJarCreator.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/TestJarCreator.java index 6303e8808c..6844282800 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/TestJarCreator.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/TestJarCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -98,6 +98,7 @@ public abstract class TestJarCreator { writeEntry(jarOutputStream, "META-INF/versions/11/multi-release.dat", 11); writeEntry(jarOutputStream, "META-INF/versions/12/multi-release.dat", 12); writeEntry(jarOutputStream, "META-INF/versions/13/multi-release.dat", 13); + writeEntry(jarOutputStream, "META-INF/versions/14/multi-release.dat", 14); } else { writeEntry(jarOutputStream, "3.dat", 3); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/system/JavaVersion.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/system/JavaVersion.java index 7bce2652fc..e6fcb3ed01 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/system/JavaVersion.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/system/JavaVersion.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package org.springframework.boot.system; +import java.lang.invoke.MethodHandles; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -60,7 +61,12 @@ public enum JavaVersion { /** * Java 13. */ - THIRTEEN("13", String.class, "stripIndent"); + THIRTEEN("13", String.class, "stripIndent"), + + /** + * Java 14. + */ + FOURTEEN("14", MethodHandles.Lookup.class, "hasFullPrivilegeAccess"); private final String name; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/pom.xml index 2b0b0fd109..69e97ad807 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/pom.xml +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/pom.xml @@ -48,4 +48,23 @@ + + + java14+ + + [14,) + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + + From 0e796479dc353d91ea12389b1eeded8d2bd7aa7e Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Fri, 6 Mar 2020 18:01:35 +0100 Subject: [PATCH 3/3] Add Java 14 CI Closes gh-20576 --- ci/images/get-jdk-url.sh | 3 + .../spring-boot-jdk14-ci-image/Dockerfile | 11 +++ ci/pipeline.yml | 69 ++++++++++++++++++- ci/scripts/detect-jdk-updates.sh | 4 ++ 4 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 ci/images/spring-boot-jdk14-ci-image/Dockerfile diff --git a/ci/images/get-jdk-url.sh b/ci/images/get-jdk-url.sh index 2829f493b2..5fa09c71e0 100755 --- a/ci/images/get-jdk-url.sh +++ b/ci/images/get-jdk-url.sh @@ -11,6 +11,9 @@ case "$1" in java13) echo "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.2%2B8/OpenJDK13U-jdk_x64_linux_hotspot_13.0.2_8.tar.gz" ;; + java14) + echo "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14%2B36/OpenJDK14U-jdk_x64_linux_hotspot_14_36.tar.gz" + ;; *) echo $"Unknown java version" exit 1 diff --git a/ci/images/spring-boot-jdk14-ci-image/Dockerfile b/ci/images/spring-boot-jdk14-ci-image/Dockerfile new file mode 100644 index 0000000000..1a21ebc4fa --- /dev/null +++ b/ci/images/spring-boot-jdk14-ci-image/Dockerfile @@ -0,0 +1,11 @@ +FROM ubuntu:bionic-20200311 + +ADD setup.sh /setup.sh +ADD get-jdk-url.sh /get-jdk-url.sh +RUN ./setup.sh java14 + +ENV JAVA_HOME /opt/openjdk +ENV PATH $JAVA_HOME/bin:$PATH +ADD docker-lib.sh /docker-lib.sh + +ENTRYPOINT [ "switch", "shell=/bin/bash", "--", "codep", "/bin/docker daemon" ] diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 20dcb78dbc..c7b74c1b35 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -94,6 +94,14 @@ resources: username: ((docker-hub-username)) password: ((docker-hub-password)) tag: 2.2.x +- name: spring-boot-jdk14-ci-image + type: docker-image + icon: docker + source: + repository: ((docker-hub-organization))/spring-boot-jdk14-ci-image + username: ((docker-hub-username)) + password: ((docker-hub-password)) + tag: 2.2.x - name: artifactory-repo type: artifactory-resource icon: package-variant @@ -126,6 +134,14 @@ resources: access_token: ((github-ci-status-token)) branch: ((branch)) context: jdk13-build +- name: repo-status-jdk14-build + type: github-status-resource + icon: eye-check-outline + source: + repository: ((github-repo-name)) + access_token: ((github-ci-status-token)) + branch: ((branch)) + context: jdk14-build - name: slack-alert type: slack-notification icon: slack @@ -160,6 +176,10 @@ jobs: params: build: ci-images-git-repo/ci/images dockerfile: ci-images-git-repo/ci/images/spring-boot-jdk13-ci-image/Dockerfile + - put: spring-boot-jdk14-ci-image + params: + build: ci-images-git-repo/ci/images + dockerfile: ci-images-git-repo/ci/images/spring-boot-jdk14-ci-image/Dockerfile - name: detect-jdk-updates plan: - get: git-repo @@ -194,6 +214,15 @@ jobs: GITHUB_USERNAME: ((github-username)) JDK_VERSION: java13 image: spring-boot-ci-image + - task: detect-jdk14-update + file: git-repo/ci/tasks/detect-jdk-updates.yml + params: + GITHUB_REPO: spring-boot + GITHUB_ORGANIZATION: spring-projects + GITHUB_PASSWORD: ((github-password)) + GITHUB_USERNAME: ((github-username)) + JDK_VERSION: java14 + image: spring-boot-ci-image - name: detect-ubuntu-image-updates plan: - get: git-repo @@ -413,6 +442,44 @@ jobs: silent: true icon_emoji: ":concourse:" username: concourse-ci +- name: jdk14-build + serial: true + public: true + plan: + - get: spring-boot-jdk14-ci-image + - get: git-repo + trigger: true + - put: repo-status-jdk14-build + params: { state: "pending", commit: "git-repo" } + - do: + - task: build-project + privileged: true + timeout: ((task-timeout)) + image: spring-boot-jdk14-ci-image + file: git-repo/ci/tasks/build-project.yml + params: + BRANCH: ((branch)) + GRADLE_ENTERPRISE_ACCESS_KEY: ((gradle_enterprise_secret_access_key)) + GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle_enterprise_cache_user.username)) + GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle_enterprise_cache_user.password)) + on_failure: + do: + - put: repo-status-jdk14-build + params: { state: "failure", commit: "git-repo" } + - put: slack-alert + params: + text: ":concourse-failed: " + silent: true + icon_emoji: ":concourse:" + username: concourse-ci + - put: repo-status-jdk14-build + params: { state: "success", commit: "git-repo" } + - put: slack-alert + params: + text: ":concourse-succeeded: " + silent: true + icon_emoji: ":concourse:" + username: concourse-ci - name: windows-build serial: true plan: @@ -615,7 +682,7 @@ jobs: body: generated-release-notes/release-notes.md groups: - name: "Build" - jobs: ["build", "jdk11-build", "jdk13-build", "windows-build"] + jobs: ["build", "jdk11-build", "jdk13-build", "jdk14-build", "windows-build"] - name: "Release" jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "sync-to-maven-central"] - name: "CI Images" diff --git a/ci/scripts/detect-jdk-updates.sh b/ci/scripts/detect-jdk-updates.sh index 706d063b82..42503f9791 100755 --- a/ci/scripts/detect-jdk-updates.sh +++ b/ci/scripts/detect-jdk-updates.sh @@ -13,6 +13,10 @@ case "$JDK_VERSION" in BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/13" ISSUE_TITLE="Upgrade Java 13 version in CI image" ;; + java14) + BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/14" + ISSUE_TITLE="Upgrade Java 14 version in CI image" + ;; *) echo $"Unknown java version" exit 1;