From 59bd6879a26830745fb375d40e42ac3a855a6a22 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 3 Aug 2023 14:55:32 +0100 Subject: [PATCH] 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") }