From 00e46192e4122523a6b8fec09bb2152941c49db5 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 3 Aug 2023 14:52:14 +0100 Subject: [PATCH 1/9] Fix handling of potential ugrade issues with no space in title --- .../boot/build/bom/bomr/UpgradeDependencies.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java index 47c2c0dcf0b..c0448a8fb81 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java @@ -189,9 +189,12 @@ public abstract class UpgradeDependencies extends DefaultTask { private Issue findExistingUpgradeIssue(List existingUpgradeIssues, Upgrade upgrade) { String toMatch = "Upgrade to " + upgrade.getLibrary().getName(); for (Issue existingUpgradeIssue : existingUpgradeIssues) { - if (existingUpgradeIssue.getTitle() - .substring(0, existingUpgradeIssue.getTitle().lastIndexOf(' ')) - .equals(toMatch)) { + String title = existingUpgradeIssue.getTitle(); + int lastSpaceIndex = title.lastIndexOf(' '); + if (lastSpaceIndex > -1) { + title = title.substring(0, lastSpaceIndex); + } + if (title.equals(toMatch)) { return existingUpgradeIssue; } } From f24b56b5418ea25a660a6e73a7bb635b63475b9d Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 3 Aug 2023 14:55:22 +0100 Subject: [PATCH 2/9] Upgrade to API Guardian 1.1.2 Closes gh-36703 --- spring-boot-project/spring-boot-parent/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-parent/build.gradle b/spring-boot-project/spring-boot-parent/build.gradle index 8520d9e09e9..eeaea3459b7 100644 --- a/spring-boot-project/spring-boot-parent/build.gradle +++ b/spring-boot-project/spring-boot-parent/build.gradle @@ -20,7 +20,7 @@ bom { ] } } - library("API Guardian", "1.1.0") { + library("API Guardian", "1.1.2") { group("org.apiguardian") { modules = [ "apiguardian-api" From a709625c249b081cda9b1507c1519aaa3a829d26 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 3 Aug 2023 14:55:27 +0100 Subject: [PATCH 3/9] Upgrade to Commons FileUpload 1.5 Closes gh-36704 --- spring-boot-project/spring-boot-parent/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-parent/build.gradle b/spring-boot-project/spring-boot-parent/build.gradle index eeaea3459b7..39d2f7e1289 100644 --- a/spring-boot-project/spring-boot-parent/build.gradle +++ b/spring-boot-project/spring-boot-parent/build.gradle @@ -41,7 +41,7 @@ bom { ] } } - library("Commons FileUpload", "1.4") { + library("Commons FileUpload", "1.5") { group("commons-fileupload") { modules = [ "commons-fileupload" From 59bd6879a26830745fb375d40e42ac3a855a6a22 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 3 Aug 2023 14:55:32 +0100 Subject: [PATCH 4/9] Upgrade to Maven 3.9.4 Closes gh-36705 --- .../boot/cli/compiler/maven/MavenSettings.java | 7 +++++-- spring-boot-project/spring-boot-parent/build.gradle | 2 +- .../spring-boot-maven-plugin/build.gradle | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/maven/MavenSettings.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/maven/MavenSettings.java index 9286acc83b2..ff28022153a 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/maven/MavenSettings.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/maven/MavenSettings.java @@ -32,6 +32,7 @@ import org.apache.maven.model.ActivationProperty; import org.apache.maven.model.building.ModelProblemCollector; import org.apache.maven.model.building.ModelProblemCollectorRequest; import org.apache.maven.model.path.DefaultPathTranslator; +import org.apache.maven.model.path.ProfileActivationFilePathInterpolator; import org.apache.maven.model.profile.DefaultProfileSelector; import org.apache.maven.model.profile.ProfileActivationContext; import org.apache.maven.model.profile.activation.FileProfileActivator; @@ -173,8 +174,10 @@ public class MavenSettings { private DefaultProfileSelector createProfileSelector() { DefaultProfileSelector selector = new DefaultProfileSelector(); - - selector.addProfileActivator(new FileProfileActivator().setPathTranslator(new DefaultPathTranslator())); + ProfileActivationFilePathInterpolator profileActivationFilePathInterpolator = new ProfileActivationFilePathInterpolator(); + profileActivationFilePathInterpolator.setPathTranslator(new DefaultPathTranslator()); + selector.addProfileActivator(new FileProfileActivator() + .setProfileActivationFilePathInterpolator(profileActivationFilePathInterpolator)); selector.addProfileActivator(new JdkVersionProfileActivator()); selector.addProfileActivator(new PropertyProfileActivator()); selector.addProfileActivator(new OperatingSystemProfileActivator()); diff --git a/spring-boot-project/spring-boot-parent/build.gradle b/spring-boot-project/spring-boot-parent/build.gradle index 39d2f7e1289..c2a756374c5 100644 --- a/spring-boot-project/spring-boot-parent/build.gradle +++ b/spring-boot-project/spring-boot-parent/build.gradle @@ -80,7 +80,7 @@ bom { ] } } - library("Maven", "3.6.3") { + library("Maven", "3.9.4") { group("org.apache.maven") { modules = [ "maven-plugin-api", diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/build.gradle index 59785c427ff..00c9b2106d1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/build.gradle @@ -16,10 +16,12 @@ dependencies { compileOnly("org.apache.maven.plugin-tools:maven-plugin-annotations") compileOnly("org.sonatype.plexus:plexus-build-api") compileOnly("org.apache.maven.shared:maven-common-artifact-filters") { + exclude(group: "javax.annotation", module: "javax.annotation-api") exclude(group: "javax.enterprise", module: "cdi-api") exclude(group: "javax.inject", module: "javax.inject") } compileOnly("org.apache.maven:maven-plugin-api") { + exclude(group: "javax.annotation", module: "javax.annotation-api") exclude(group: "javax.enterprise", module: "cdi-api") exclude(group: "javax.inject", module: "javax.inject") } @@ -39,6 +41,7 @@ dependencies { intTestImplementation("org.testcontainers:junit-jupiter") mavenOptionalImplementation("org.apache.maven.plugins:maven-shade-plugin") { + exclude(group: "javax.annotation", module: "javax.annotation-api") exclude(group: "javax.enterprise", module: "cdi-api") exclude(group: "javax.inject", module: "javax.inject") } From 7fcf4c7dcf990b1cf73086a89472b8aa4c556a6a Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 3 Aug 2023 14:55:37 +0100 Subject: [PATCH 5/9] Upgrade to Maven Invoker 3.2.0 Closes gh-36706 --- spring-boot-project/spring-boot-parent/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-parent/build.gradle b/spring-boot-project/spring-boot-parent/build.gradle index c2a756374c5..b2cba69cbea 100644 --- a/spring-boot-project/spring-boot-parent/build.gradle +++ b/spring-boot-project/spring-boot-parent/build.gradle @@ -96,7 +96,7 @@ bom { ] } } - library("Maven Invoker", "3.1.0") { + library("Maven Invoker", "3.2.0") { group("org.apache.maven.shared") { modules = [ "maven-invoker" From 2c7fe47529c1190b31200c1e9401e05014b797be Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 3 Aug 2023 14:55:42 +0100 Subject: [PATCH 6/9] Upgrade to Maven Resolver 1.9.14 Closes gh-36707 --- .../compiler/grape/AetherGrapeEngineFactory.java | 7 +++---- .../grape/MavenResolverGrapeEngineFactory.java | 12 ++++++------ .../spring-boot-parent/build.gradle | 2 +- .../classpath/ModifiedClassPathClassLoader.java | 16 +++++++++++----- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineFactory.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineFactory.java index c73112c862a..8725e25fb27 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineFactory.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineFactory.java @@ -25,13 +25,11 @@ import org.apache.maven.repository.internal.MavenRepositorySystemUtils; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory; -import org.eclipse.aether.impl.DefaultServiceLocator; import org.eclipse.aether.internal.impl.DefaultRepositorySystem; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; import org.eclipse.aether.spi.connector.transport.TransporterFactory; -import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.transport.file.FileTransporterFactory; import org.eclipse.aether.transport.http.HttpTransporterFactory; @@ -51,6 +49,7 @@ public abstract class AetherGrapeEngineFactory { DependencyResolutionContext dependencyResolutionContext, boolean quiet) { RepositorySystem repositorySystem = createServiceLocator().getService(RepositorySystem.class); DefaultRepositorySystemSession repositorySystemSession = MavenRepositorySystemUtils.newSession(); + repositorySystemSession.setSystemProperties(System.getProperties()); ServiceLoader autoConfigurations = ServiceLoader .load(RepositorySystemSessionAutoConfiguration.class); for (RepositorySystemSessionAutoConfiguration autoConfiguration : autoConfigurations) { @@ -61,8 +60,8 @@ public abstract class AetherGrapeEngineFactory { createRepositories(repositoryConfigurations), dependencyResolutionContext, quiet); } - private static ServiceLocator createServiceLocator() { - DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator(); + private static org.eclipse.aether.impl.DefaultServiceLocator createServiceLocator() { + org.eclipse.aether.impl.DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator(); locator.addService(RepositorySystem.class, DefaultRepositorySystem.class); locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class); locator.addService(TransporterFactory.class, HttpTransporterFactory.class); diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/MavenResolverGrapeEngineFactory.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/MavenResolverGrapeEngineFactory.java index 95535af00ba..a0fdd1437df 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/MavenResolverGrapeEngineFactory.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/MavenResolverGrapeEngineFactory.java @@ -25,13 +25,11 @@ import org.apache.maven.repository.internal.MavenRepositorySystemUtils; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory; -import org.eclipse.aether.impl.DefaultServiceLocator; import org.eclipse.aether.internal.impl.DefaultRepositorySystem; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; import org.eclipse.aether.spi.connector.transport.TransporterFactory; -import org.eclipse.aether.spi.locator.ServiceLocator; import org.eclipse.aether.transport.file.FileTransporterFactory; import org.eclipse.aether.transport.http.HttpTransporterFactory; @@ -46,8 +44,9 @@ public abstract class MavenResolverGrapeEngineFactory { public static MavenResolverGrapeEngine create(GroovyClassLoader classLoader, List repositoryConfigurations, DependencyResolutionContext dependencyResolutionContext, boolean quiet) { - RepositorySystem repositorySystem = createServiceLocator().getService(RepositorySystem.class); + RepositorySystem repositorySystem = createRepositorySystem(); DefaultRepositorySystemSession repositorySystemSession = MavenRepositorySystemUtils.newSession(); + repositorySystemSession.setSystemProperties(System.getProperties()); ServiceLoader autoConfigurations = ServiceLoader .load(RepositorySystemSessionAutoConfiguration.class); for (RepositorySystemSessionAutoConfiguration autoConfiguration : autoConfigurations) { @@ -58,13 +57,14 @@ public abstract class MavenResolverGrapeEngineFactory { createRepositories(repositoryConfigurations), dependencyResolutionContext, quiet); } - private static ServiceLocator createServiceLocator() { - DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator(); + @SuppressWarnings("deprecation") + private static RepositorySystem createRepositorySystem() { + org.eclipse.aether.impl.DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator(); locator.addService(RepositorySystem.class, DefaultRepositorySystem.class); locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class); locator.addService(TransporterFactory.class, HttpTransporterFactory.class); locator.addService(TransporterFactory.class, FileTransporterFactory.class); - return locator; + return locator.getService(RepositorySystem.class); } private static List createRepositories(List repositoryConfigurations) { diff --git a/spring-boot-project/spring-boot-parent/build.gradle b/spring-boot-project/spring-boot-parent/build.gradle index b2cba69cbea..cf22876ca12 100644 --- a/spring-boot-project/spring-boot-parent/build.gradle +++ b/spring-boot-project/spring-boot-parent/build.gradle @@ -110,7 +110,7 @@ bom { ] } } - library("Maven Resolver", "1.6.3") { + library("Maven Resolver", "1.9.14") { group("org.apache.maven.resolver") { modules = [ "maven-resolver-api", diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathClassLoader.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathClassLoader.java index 29e7d1607b6..cb12489cee8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathClassLoader.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathClassLoader.java @@ -43,7 +43,6 @@ import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.CollectRequest; import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory; import org.eclipse.aether.graph.Dependency; -import org.eclipse.aether.impl.DefaultServiceLocator; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ArtifactResult; @@ -231,11 +230,9 @@ final class ModifiedClassPathClassLoader extends URLClassLoader { private static List resolveCoordinates(String[] coordinates) { Exception latestFailure = null; - DefaultServiceLocator serviceLocator = MavenRepositorySystemUtils.newServiceLocator(); - serviceLocator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class); - serviceLocator.addService(TransporterFactory.class, HttpTransporterFactory.class); - RepositorySystem repositorySystem = serviceLocator.getService(RepositorySystem.class); + RepositorySystem repositorySystem = createRepositorySystem(); DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession(); + session.setSystemProperties(System.getProperties()); LocalRepository localRepository = new LocalRepository(System.getProperty("user.home") + "/.m2/repository"); RemoteRepository remoteRepository = new RemoteRepository.Builder("central", "default", "https://repo.maven.apache.org/maven2") @@ -261,6 +258,15 @@ final class ModifiedClassPathClassLoader extends URLClassLoader { latestFailure); } + @SuppressWarnings("deprecation") + private static RepositorySystem createRepositorySystem() { + org.eclipse.aether.impl.DefaultServiceLocator serviceLocator = MavenRepositorySystemUtils.newServiceLocator(); + serviceLocator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class); + serviceLocator.addService(TransporterFactory.class, HttpTransporterFactory.class); + RepositorySystem repositorySystem = serviceLocator.getService(RepositorySystem.class); + return repositorySystem; + } + private static List createDependencies(String[] allCoordinates) { List dependencies = new ArrayList<>(); for (String coordinate : allCoordinates) { From 4b552d5c4495fd73bd543893de4031c9f20db9bb Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 3 Aug 2023 14:55:47 +0100 Subject: [PATCH 7/9] Upgrade to MockK 1.13.5 Closes gh-36708 --- spring-boot-project/spring-boot-parent/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-parent/build.gradle b/spring-boot-project/spring-boot-parent/build.gradle index cf22876ca12..d17abb2a539 100644 --- a/spring-boot-project/spring-boot-parent/build.gradle +++ b/spring-boot-project/spring-boot-parent/build.gradle @@ -130,7 +130,7 @@ bom { ] } } - library("MockK", "1.10.6") { + library("MockK", "1.13.5") { group("io.mockk") { modules = [ "mockk" From f0d2f6e9913a782068dc36ef9a34fb3ec3031202 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 3 Aug 2023 14:55:52 +0100 Subject: [PATCH 8/9] Upgrade to Spock Framework 2.3-groovy-3.0 Closes gh-36709 --- spring-boot-project/spring-boot-parent/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-parent/build.gradle b/spring-boot-project/spring-boot-parent/build.gradle index d17abb2a539..f586696bc67 100644 --- a/spring-boot-project/spring-boot-parent/build.gradle +++ b/spring-boot-project/spring-boot-parent/build.gradle @@ -172,7 +172,7 @@ bom { ] } } - library("Spock Framework", "2.0-groovy-3.0") { + library("Spock Framework", "2.3-groovy-3.0") { group("org.spockframework") { modules = [ "spock-core", From 80a6873a9803ede68c034fe41c4494ee9610d6e9 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 3 Aug 2023 14:55:57 +0100 Subject: [PATCH 9/9] Upgrade to Testcontainers 1.18.3 Closes gh-36710 --- spring-boot-project/spring-boot-parent/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-parent/build.gradle b/spring-boot-project/spring-boot-parent/build.gradle index f586696bc67..910604dd5c4 100644 --- a/spring-boot-project/spring-boot-parent/build.gradle +++ b/spring-boot-project/spring-boot-parent/build.gradle @@ -195,7 +195,7 @@ bom { ] } } - library("Testcontainers", "1.17.3") { + library("Testcontainers", "1.18.3") { group("org.testcontainers") { imports = [ "testcontainers-bom"