diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
index 6176fc8b5c1..b7beebd58ed 100644
--- a/buildSrc/build.gradle
+++ b/buildSrc/build.gradle
@@ -10,8 +10,8 @@ repositories {
maven { url "https://repo.spring.io/release" }
}
-sourceCompatibility = 1.8
-targetCompatibility = 1.8
+sourceCompatibility = 17
+targetCompatibility = 17
dependencies {
checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}"
@@ -22,8 +22,8 @@ dependencies {
implementation("org.gradle:test-retry-gradle-plugin:1.1.9")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0")
implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.5.0")
- implementation("org.springframework:spring-core:5.2.2.RELEASE")
- implementation("org.springframework:spring-web:5.2.2.RELEASE")
+ implementation("org.springframework:spring-core:5.3.10")
+ implementation("org.springframework:spring-web:5.3.10")
implementation("io.spring.javaformat:spring-javaformat-gradle-plugin:${javaFormatVersion}")
testImplementation("org.assertj:assertj-core:3.11.1")
testImplementation("org.apache.logging.log4j:log4j-core:2.12.1")
diff --git a/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java b/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java
index d82ba98cec5..1d4614033b9 100644
--- a/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java
+++ b/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java
@@ -45,6 +45,7 @@ import org.gradle.api.tasks.bundling.Jar;
import org.gradle.api.tasks.compile.JavaCompile;
import org.gradle.api.tasks.javadoc.Javadoc;
import org.gradle.api.tasks.testing.Test;
+import org.gradle.external.javadoc.CoreJavadocOptions;
import org.gradle.testretry.TestRetryPlugin;
import org.gradle.testretry.TestRetryTaskExtension;
@@ -59,7 +60,7 @@ import org.springframework.util.StringUtils;
* plugin is applied:
*
*
- * - The project is configured with source and target compatibility of 1.8
+ *
- The project is configured with source and target compatibility of 17
*
- {@link SpringJavaFormatPlugin Spring Java Format}, {@link CheckstylePlugin
* Checkstyle}, {@link TestFailuresPlugin Test Failures}, and {@link TestRetryPlugin Test
* Retry} plugins are applied
@@ -74,9 +75,9 @@ import org.springframework.util.StringUtils;
* {@link JavaPlugin} applied
*
- {@link JavaCompile}, {@link Javadoc}, and {@link Format} tasks are configured to
* use UTF-8 encoding
- *
- {@link JavaCompile} tasks are configured to use {@code -parameters}.
- *
- When building with Java 8, {@link JavaCompile} tasks are also configured to:
+ *
- {@link JavaCompile} tasks are configured to:
*
+ * - Use {@code -parameters}.
*
- Treat warnings as errors
*
- Enable {@code unchecked}, {@code deprecation}, {@code rawtypes}, and {@code varags}
* warnings
@@ -102,7 +103,7 @@ import org.springframework.util.StringUtils;
*/
class JavaConventions {
- private static final String SOURCE_AND_TARGET_COMPATIBILITY = "1.8";
+ private static final String SOURCE_AND_TARGET_COMPATIBILITY = "17";
void apply(Project project) {
project.getPlugins().withType(JavaBasePlugin.class, (java) -> {
@@ -178,7 +179,12 @@ class JavaConventions {
}
private void configureJavadocConventions(Project project) {
- project.getTasks().withType(Javadoc.class, (javadoc) -> javadoc.getOptions().source("1.8").encoding("UTF-8"));
+ project.getTasks().withType(Javadoc.class, (javadoc) -> {
+ CoreJavadocOptions options = (CoreJavadocOptions) javadoc.getOptions();
+ options.source("17");
+ options.encoding("UTF-8");
+ options.addStringOption("Xdoclint:none", "-quiet");
+ });
}
private void configureJavaConventions(Project project) {
@@ -196,17 +202,11 @@ class JavaConventions {
compile.setSourceCompatibility(SOURCE_AND_TARGET_COMPATIBILITY);
compile.setTargetCompatibility(SOURCE_AND_TARGET_COMPATIBILITY);
}
- else if (buildingWithJava8(project)) {
- args.addAll(Arrays.asList("-Werror", "-Xlint:unchecked", "-Xlint:deprecation", "-Xlint:rawtypes",
- "-Xlint:varargs"));
- }
+ args.addAll(Arrays.asList("-Werror", "-Xlint:unchecked", "-Xlint:deprecation", "-Xlint:rawtypes",
+ "-Xlint:varargs"));
});
}
- private boolean buildingWithJava8(Project project) {
- return !project.hasProperty("toolchainVersion") && JavaVersion.current() == JavaVersion.VERSION_1_8;
- }
-
private void configureSpringJavaFormat(Project project) {
project.getPlugins().apply(SpringJavaFormatPlugin.class);
project.getTasks().withType(Format.class, (Format) -> Format.setEncoding("UTF-8"));
diff --git a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java
index 79e1b197de6..aa3b2a8ff97 100644
--- a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java
+++ b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java
@@ -144,7 +144,7 @@ public class MavenPluginPlugin implements Plugin {
private MavenExec createGenerateHelpMojoTask(Project project, File helpMojoDir) {
MavenExec task = project.getTasks().create("generateHelpMojo", MavenExec.class);
task.setProjectDir(helpMojoDir);
- task.args("org.apache.maven.plugins:maven-plugin-plugin:3.6.0:helpmojo");
+ task.args("org.apache.maven.plugins:maven-plugin-plugin:3.6.1:helpmojo");
task.getOutputs().dir(new File(helpMojoDir, "target/generated-sources/plugin"));
return task;
}
@@ -211,7 +211,7 @@ public class MavenPluginPlugin implements Plugin {
private MavenExec createGeneratePluginDescriptorTask(Project project, File mavenDir) {
MavenExec generatePluginDescriptor = project.getTasks().create("generatePluginDescriptor", MavenExec.class);
- generatePluginDescriptor.args("org.apache.maven.plugins:maven-plugin-plugin:3.6.0:descriptor");
+ generatePluginDescriptor.args("org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor");
generatePluginDescriptor.getOutputs().dir(new File(mavenDir, "target/classes/META-INF/maven"));
generatePluginDescriptor.getInputs().dir(new File(mavenDir, "target/classes/org"))
.withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("plugin classes");
diff --git a/buildSrc/src/test/java/org/springframework/boot/build/ConventionsPluginTests.java b/buildSrc/src/test/java/org/springframework/boot/build/ConventionsPluginTests.java
index 81b896bea9e..eb4127fdf1d 100644
--- a/buildSrc/src/test/java/org/springframework/boot/build/ConventionsPluginTests.java
+++ b/buildSrc/src/test/java/org/springframework/boot/build/ConventionsPluginTests.java
@@ -73,7 +73,7 @@ class ConventionsPluginTests {
out.println(" id 'org.springframework.boot.conventions'");
out.println("}");
out.println("version = '1.2.3'");
- out.println("sourceCompatibility = '1.8'");
+ out.println("sourceCompatibility = '17'");
out.println("description 'Test project for manifest customization'");
out.println("jar.archiveFileName = 'test.jar'");
}
@@ -90,7 +90,7 @@ class ConventionsPluginTests {
.isEqualTo(this.projectDir.getName().replace("-", "."));
assertThat(mainAttributes.getValue("Implementation-Version")).isEqualTo("1.2.3");
assertThat(mainAttributes.getValue("Built-By")).isEqualTo("Spring");
- assertThat(mainAttributes.getValue("Build-Jdk-Spec")).isEqualTo("1.8");
+ assertThat(mainAttributes.getValue("Build-Jdk-Spec")).isEqualTo("17");
}
}
@@ -103,7 +103,7 @@ class ConventionsPluginTests {
out.println(" id 'org.springframework.boot.conventions'");
out.println("}");
out.println("version = '1.2.3'");
- out.println("sourceCompatibility = '1.8'");
+ out.println("sourceCompatibility = '17'");
out.println("description 'Test'");
out.println("repositories {");
out.println(" mavenCentral()");
@@ -125,7 +125,7 @@ class ConventionsPluginTests {
.isEqualTo(this.projectDir.getName().replace("-", "."));
assertThat(mainAttributes.getValue("Implementation-Version")).isEqualTo("1.2.3");
assertThat(mainAttributes.getValue("Built-By")).isEqualTo("Spring");
- assertThat(mainAttributes.getValue("Build-Jdk-Spec")).isEqualTo("1.8");
+ assertThat(mainAttributes.getValue("Build-Jdk-Spec")).isEqualTo("17");
}
}
@@ -138,7 +138,7 @@ class ConventionsPluginTests {
out.println(" id 'org.springframework.boot.conventions'");
out.println("}");
out.println("version = '1.2.3'");
- out.println("sourceCompatibility = '1.8'");
+ out.println("sourceCompatibility = '17'");
out.println("description 'Test'");
out.println("repositories {");
out.println(" mavenCentral()");
@@ -160,7 +160,7 @@ class ConventionsPluginTests {
.isEqualTo(this.projectDir.getName().replace("-", "."));
assertThat(mainAttributes.getValue("Implementation-Version")).isEqualTo("1.2.3");
assertThat(mainAttributes.getValue("Built-By")).isEqualTo("Spring");
- assertThat(mainAttributes.getValue("Build-Jdk-Spec")).isEqualTo("1.8");
+ assertThat(mainAttributes.getValue("Build-Jdk-Spec")).isEqualTo("17");
}
}
diff --git a/ci/images/ci-image-jdk11/Dockerfile b/ci/images/ci-image-jdk11/Dockerfile
deleted file mode 100644
index 75c043fbfae..00000000000
--- a/ci/images/ci-image-jdk11/Dockerfile
+++ /dev/null
@@ -1,12 +0,0 @@
-FROM ubuntu:focal-20211006
-
-ADD setup.sh /setup.sh
-ADD get-jdk-url.sh /get-jdk-url.sh
-ADD get-docker-url.sh /get-docker-url.sh
-RUN ./setup.sh java11
-
-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/images/ci-image-jdk17/Dockerfile b/ci/images/ci-image-jdk17/Dockerfile
deleted file mode 100644
index a23e34aed08..00000000000
--- a/ci/images/ci-image-jdk17/Dockerfile
+++ /dev/null
@@ -1,12 +0,0 @@
-FROM ubuntu:focal-20211006
-
-ADD setup.sh /setup.sh
-ADD get-jdk-url.sh /get-jdk-url.sh
-ADD get-docker-url.sh /get-docker-url.sh
-RUN ./setup.sh java8 java17
-
-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/images/ci-image/Dockerfile b/ci/images/ci-image/Dockerfile
index 36c2ba862b4..32e9f076066 100644
--- a/ci/images/ci-image/Dockerfile
+++ b/ci/images/ci-image/Dockerfile
@@ -3,7 +3,7 @@ FROM ubuntu:focal-20211006
ADD setup.sh /setup.sh
ADD get-jdk-url.sh /get-jdk-url.sh
ADD get-docker-url.sh /get-docker-url.sh
-RUN ./setup.sh java8
+RUN ./setup.sh java17
ENV JAVA_HOME /opt/openjdk
ENV PATH $JAVA_HOME/bin:$PATH
diff --git a/ci/images/get-jdk-url.sh b/ci/images/get-jdk-url.sh
index f20501cad68..0c020e7b6ae 100755
--- a/ci/images/get-jdk-url.sh
+++ b/ci/images/get-jdk-url.sh
@@ -2,12 +2,6 @@
set -e
case "$1" in
- java8)
- echo "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u312-b07/OpenJDK8U-jdk_x64_linux_hotspot_8u312b07.tar.gz"
- ;;
- java11)
- echo "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.13%2B8/OpenJDK11U-jdk_x64_linux_hotspot_11.0.13_8.tar.gz"
- ;;
java17)
echo "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz"
;;
diff --git a/ci/pipeline.yml b/ci/pipeline.yml
index 42558839e98..998dcb9665b 100644
--- a/ci/pipeline.yml
+++ b/ci/pipeline.yml
@@ -171,18 +171,6 @@ resources:
source:
<<: *registry-image-resource-source
repository: ((docker-hub-organization))/spring-boot-ci
-- name: ci-image-jdk11
- type: registry-image
- icon: docker
- source:
- <<: *registry-image-resource-source
- repository: ((docker-hub-organization))/spring-boot-ci-jdk11
-- name: ci-image-jdk17
- type: registry-image
- icon: docker
- source:
- <<: *registry-image-resource-source
- repository: ((docker-hub-organization))/spring-boot-ci-jdk17
- name: paketo-builder-base-image
type: registry-image
icon: docker
@@ -205,22 +193,6 @@ resources:
access_token: ((github-ci-status-token))
branch: ((branch))
context: build
-- name: repo-status-jdk11-build
- type: github-status-resource
- icon: eye-check-outline
- source:
- repository: ((github-repo-name))
- access_token: ((github-ci-status-token))
- branch: ((branch))
- context: jdk11-build
-- name: repo-status-jdk17-build
- type: github-status-resource
- icon: eye-check-outline
- source:
- repository: ((github-repo-name))
- access_token: ((github-ci-status-token))
- branch: ((branch))
- context: jdk17-build
- name: slack-alert
type: slack-notification
icon: slack
@@ -248,66 +220,29 @@ jobs:
- get: ci-images-git-repo
trigger: true
- get: git-repo
- - in_parallel:
- - task: build-ci-image
- privileged: true
- file: git-repo/ci/tasks/build-ci-image.yml
- output_mapping:
- image: ci-image
- vars:
- ci-image-name: ci-image
- <<: *docker-hub-mirror-vars
- - task: build-ci-image-jdk11
- privileged: true
- file: git-repo/ci/tasks/build-ci-image.yml
- output_mapping:
- image: ci-image-jdk11
- vars:
- ci-image-name: ci-image-jdk11
- <<: *docker-hub-mirror-vars
- - task: build-ci-image-jdk17
- privileged: true
- file: git-repo/ci/tasks/build-ci-image.yml
- output_mapping:
- image: ci-image-jdk17
- vars:
- ci-image-name: ci-image-jdk17
- <<: *docker-hub-mirror-vars
- - in_parallel:
- - put: ci-image
- params:
- image: ci-image/image.tar
- - put: ci-image-jdk11
- params:
- image: ci-image-jdk11/image.tar
- - put: ci-image-jdk17
- params:
- image: ci-image-jdk17/image.tar
+ - task: build-ci-image
+ privileged: true
+ file: git-repo/ci/tasks/build-ci-image.yml
+ output_mapping:
+ image: ci-image
+ vars:
+ ci-image-name: ci-image
+ <<: *docker-hub-mirror-vars
+ - put: ci-image
+ params:
+ image: ci-image/image.tar
- name: detect-jdk-updates
plan:
- get: git-repo
- get: every-wednesday
trigger: true
- get: ci-image
- - in_parallel:
- - task: detect-jdk8-update
- image: ci-image
- file: git-repo/ci/tasks/detect-jdk-updates.yml
- params:
- <<: *github-task-params
- JDK_VERSION: java8
- - task: detect-jdk11-update
- image: ci-image
- file: git-repo/ci/tasks/detect-jdk-updates.yml
- params:
- <<: *github-task-params
- JDK_VERSION: java11
- - task: detect-jdk17-update
- image: ci-image
- file: git-repo/ci/tasks/detect-jdk-updates.yml
- params:
- <<: *github-task-params
- JDK_VERSION: java17
+ - task: detect-jdk17-update
+ image: ci-image
+ file: git-repo/ci/tasks/detect-jdk-updates.yml
+ params:
+ <<: *github-task-params
+ JDK_VERSION: java17
- name: detect-ubuntu-image-updates
plan:
- get: git-repo
@@ -395,63 +330,6 @@ jobs:
params:
path: git-repo
status: failure
-- name: jdk11-build
- serial: true
- public: true
- plan:
- - get: ci-image-jdk11
- - get: git-repo
- trigger: true
- - put: repo-status-jdk11-build
- params: { state: "pending", commit: "git-repo" }
- - do:
- - task: build-project
- image: ci-image-jdk11
- <<: *build-project-task-params
- on_failure:
- do:
- - put: repo-status-jdk11-build
- params: { state: "failure", commit: "git-repo" }
- - put: slack-alert
- params:
- <<: *slack-fail-params
- - put: repo-status-jdk11-build
- params: { state: "success", commit: "git-repo" }
- - put: slack-alert
- params:
- <<: *slack-success-params
-- name: jdk17-build
- serial: true
- public: true
- plan:
- - get: ci-image-jdk17
- - get: git-repo
- trigger: true
- - put: repo-status-jdk17-build
- params: { state: "pending", commit: "git-repo" }
- - do:
- - task: build-project
- image: ci-image-jdk17
- privileged: true
- timeout: ((task-timeout))
- file: git-repo/ci/tasks/build-project.yml
- params:
- BRANCH: ((branch))
- TOOLCHAIN_JAVA_VERSION: 17
- <<: *gradle-enterprise-task-params
- <<: *docker-hub-task-params
- on_failure:
- do:
- - put: repo-status-jdk17-build
- params: { state: "failure", commit: "git-repo" }
- - put: slack-alert
- params:
- <<: *slack-fail-params
- - put: repo-status-jdk17-build
- params: { state: "success", commit: "git-repo" }
- - put: slack-alert
- params:
- <<: *slack-success-params
- name: windows-build
serial: true
plan:
@@ -725,64 +603,13 @@ jobs:
- put: slack-alert
params:
<<: *slack-success-params
-- name: jdk11-run-system-tests
- serial: true
- public: true
- plan:
- - get: ci-image-jdk11
- - get: git-repo
- - get: paketo-builder-base-image
- trigger: true
- - get: daily
- trigger: true
- - do:
- - task: run-system-tests
- image: ci-image-jdk11
- <<: *run-system-tests-task-params
- on_failure:
- do:
- - put: slack-alert
- params:
- <<: *slack-fail-params
- - put: slack-alert
- params:
- <<: *slack-success-params
-- name: jdk17-run-system-tests
- serial: true
- public: true
- plan:
- - get: ci-image-jdk17
- - get: git-repo
- - get: paketo-builder-base-image
- trigger: true
- - get: daily
- trigger: true
- - do:
- - task: run-system-tests
- image: ci-image-jdk17
- privileged: true
- timeout: ((task-timeout))
- file: git-repo/ci/tasks/run-system-tests.yml
- params:
- BRANCH: ((branch))
- TOOLCHAIN_JAVA_VERSION: 17
- <<: *gradle-enterprise-task-params
- <<: *docker-hub-task-params
- on_failure:
- do:
- - put: slack-alert
- params:
- <<: *slack-fail-params
- - put: slack-alert
- params:
- <<: *slack-success-params
groups:
- name: "builds"
- jobs: ["build", "jdk11-build", "jdk17-build", "windows-build"]
+ jobs: ["build", "windows-build"]
- name: "releases"
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release", "publish-gradle-plugin", "publish-to-sdkman", "update-homebrew-tap"]
- name: "system-tests"
- jobs: ["run-system-tests", "jdk11-run-system-tests", "jdk17-run-system-tests"]
+ jobs: ["run-system-tests"]
- name: "ci-images"
jobs: ["build-ci-images", "detect-docker-updates", "detect-jdk-updates", "detect-ubuntu-image-updates"]
- name: "pull-requests"
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java
index c90d8c3fc64..6089a76b457 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java
@@ -139,10 +139,10 @@ public class LaunchedURLClassLoader extends URLClassLoader {
}
catch (IllegalArgumentException ex) {
// Tolerate race condition due to being parallel capable
- if (getPackage(name) == null) {
+ if (getDefinedPackage(name) == null) {
// This should never happen as the IllegalArgumentException indicates
// that the package has already been defined and, therefore,
- // getPackage(name) should not return null.
+ // getDefinedPackage(name) should not return null.
throw new AssertionError("Package " + name + " has already been defined but it could not be found");
}
}
@@ -192,16 +192,17 @@ public class LaunchedURLClassLoader extends URLClassLoader {
int lastDot = className.lastIndexOf('.');
if (lastDot >= 0) {
String packageName = className.substring(0, lastDot);
- if (getPackage(packageName) == null) {
+ if (getDefinedPackage(packageName) == null) {
try {
definePackage(className, packageName);
}
catch (IllegalArgumentException ex) {
// Tolerate race condition due to being parallel capable
- if (getPackage(packageName) == null) {
+ if (getDefinedPackage(packageName) == null) {
// This should never happen as the IllegalArgumentException
// indicates that the package has already been defined and,
- // therefore, getPackage(name) should not have returned null.
+ // therefore, getDefinedPackage(name) should not have returned
+ // null.
throw new AssertionError(
"Package " + packageName + " has already been defined but it could not be found");
}
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java
index 83ec65ed16d..a23bb5860cf 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java
@@ -557,7 +557,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
try {
Class> startClass = Class.forName(this.startClassName, false, classLoader);
Method mainMethod = startClass.getMethod("main", String[].class);
- if (!mainMethod.isAccessible()) {
+ if (!mainMethod.canAccess(null)) {
mainMethod.setAccessible(true);
}
mainMethod.invoke(null, new Object[] { this.args });
diff --git a/spring-boot-project/spring-boot/build.gradle b/spring-boot-project/spring-boot/build.gradle
index 246b24ae2f0..05dcde61228 100644
--- a/spring-boot-project/spring-boot/build.gradle
+++ b/spring-boot-project/spring-boot/build.gradle
@@ -177,6 +177,6 @@ compileJava {
doLast new org.springframework.boot.build.log4j2.ReproducibleLog4j2PluginsDatAction()
}
-toolchain {
- testJvmArgs.add("--add-opens=java.base/java.net=ALL-UNNAMED")
+test {
+ jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED"
}
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java
index b59ec87f849..c8f136c433e 100644
--- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java
+++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java
@@ -256,7 +256,7 @@ class BeanDefinitionLoader {
String path = ((ClassPathResource) resource).getPath();
if (path.indexOf('.') == -1) {
try {
- return Package.getPackage(path) == null;
+ return getClass().getClassLoader().getDefinedPackage(path) == null;
}
catch (Exception ex) {
// Ignore
@@ -267,7 +267,7 @@ class BeanDefinitionLoader {
}
private Package findPackage(CharSequence source) {
- Package pkg = Package.getPackage(source.toString());
+ Package pkg = getClass().getClassLoader().getDefinedPackage(source.toString());
if (pkg != null) {
return pkg;
}
@@ -285,7 +285,7 @@ class BeanDefinitionLoader {
catch (Exception ex) {
// swallow exception and continue
}
- return Package.getPackage(source.toString());
+ return getClass().getClassLoader().getDefinedPackage(source.toString());
}
/**
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/reactor/DebugAgentEnvironmentPostProcessorTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/reactor/DebugAgentEnvironmentPostProcessorTests.java
index 034d7632f14..ac965f17a87 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/reactor/DebugAgentEnvironmentPostProcessorTests.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/reactor/DebugAgentEnvironmentPostProcessorTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2019 the original author or authors.
+ * Copyright 2012-2021 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.reactor;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import reactor.core.Scannable;
import reactor.core.publisher.Flux;
@@ -30,7 +31,8 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Brian Clozel
*/
-@ClassPathOverrides("io.projectreactor:reactor-tools:3.3.0.RELEASE")
+@Disabled("We need the not-yet-released reactor-tools 3.4.11 for JDK 17 compatibility")
+@ClassPathOverrides("io.projectreactor:reactor-tools:3.4.11")
class DebugAgentEnvironmentPostProcessorTests {
static {
diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java
index 1abe0c519cf..fdcf9d13410 100644
--- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java
+++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/intTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java
@@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@Testcontainers(disabledWithoutDocker = true)
class LoaderIntegrationTests {
- private static final DockerImageName JRE = DockerImageName.parse("adoptopenjdk:15-jre-hotspot");
+ private static final DockerImageName JRE = DockerImageName.parse("eclipse-temurin:17.0.1_12-jdk-alpine");
private static ToStringConsumer output = new ToStringConsumer();