From 07fcb675406c6a40e49422d4196531c4d03886a5 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 8 Feb 2023 14:04:16 +0000 Subject: [PATCH] Use repo.maven.apache.org consistently Maven Central has two canonical URLs [1]: - https://repo1.maven.org - https://repo.maven.apache.org This commit updates the codebase to only use repo.maven.apache.org. Closes gh-33938 [1] https://central.sonatype.org/news/20190715_http_deprecation_update/#canonical-urls --- .../org/springframework/boot/build/cli/HomebrewFormula.java | 2 +- .../spring/concourse/releasescripts/sdkman/SdkmanService.java | 2 +- .../concourse/releasescripts/sdkman/SdkmanServiceTests.java | 4 ++-- eclipse/spring-boot-project.setup | 2 +- .../cli/compiler/grape/MavenResolverGrapeEngineTests.java | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/cli/HomebrewFormula.java b/buildSrc/src/main/java/org/springframework/boot/build/cli/HomebrewFormula.java index 15f922ee52..3197b0bc29 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/cli/HomebrewFormula.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/cli/HomebrewFormula.java @@ -46,7 +46,7 @@ public class HomebrewFormula extends DefaultTask { private static final String SPRING_REPO = "https://repo.spring.io/%s"; - private static final String MAVEN_REPO = "https://repo1.maven.org/maven2"; + private static final String MAVEN_REPO = "https://repo.maven.apache.org/maven2"; private Provider archive; diff --git a/ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/sdkman/SdkmanService.java b/ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/sdkman/SdkmanService.java index 0a37de5451..dc87b92851 100644 --- a/ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/sdkman/SdkmanService.java +++ b/ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/sdkman/SdkmanService.java @@ -40,7 +40,7 @@ public class SdkmanService { private static final String SDKMAN_URL = "https://vendors.sdkman.io/"; - private static final String DOWNLOAD_URL = "https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-cli/" + private static final String DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-cli/" + "%s/spring-boot-cli-%s-bin.zip"; private static final String CHANGELOG_URL = "https://github.com/spring-projects/spring-boot/releases/tag/v%s"; diff --git a/ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/sdkman/SdkmanServiceTests.java b/ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/sdkman/SdkmanServiceTests.java index e76f1d0634..3a81ecfd3f 100644 --- a/ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/sdkman/SdkmanServiceTests.java +++ b/ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/sdkman/SdkmanServiceTests.java @@ -55,7 +55,7 @@ class SdkmanServiceTests { @Test void publishWhenMakeDefaultTrue() { setupExpectation("https://vendors.sdkman.io/release", - "{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"url\": \"https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-cli/1.2.3/spring-boot-cli-1.2.3-bin.zip\"}"); + "{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"url\": \"https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-cli/1.2.3/spring-boot-cli-1.2.3-bin.zip\"}"); setupExpectation("https://vendors.sdkman.io/default", "{\"candidate\": \"springboot\", \"version\": \"1.2.3\"}", HttpMethod.PUT); setupExpectation("https://vendors.sdkman.io/announce/struct", @@ -67,7 +67,7 @@ class SdkmanServiceTests { @Test void publishWhenMakeDefaultFalse() { setupExpectation("https://vendors.sdkman.io/release", - "{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"url\": \"https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-cli/1.2.3/spring-boot-cli-1.2.3-bin.zip\"}"); + "{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"url\": \"https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-cli/1.2.3/spring-boot-cli-1.2.3-bin.zip\"}"); setupExpectation("https://vendors.sdkman.io/announce/struct", "{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"hashtag\": \"springboot\", \"url\": \"https://github.com/spring-projects/spring-boot/releases/tag/v1.2.3\"}"); this.service.publish("1.2.3", false); diff --git a/eclipse/spring-boot-project.setup b/eclipse/spring-boot-project.setup index ee230225e4..ddc0aeb0ed 100644 --- a/eclipse/spring-boot-project.setup +++ b/eclipse/spring-boot-project.setup @@ -105,7 +105,7 @@ + url="https://repo.maven.apache.org/maven2/.m2e/connectors/m2eclipse-buildhelper/0.15.0/N/0.15.0.201405280027/"/> repositoryConfigurations = new ArrayList<>(); repositoryConfigurations - .add(new RepositoryConfiguration("central", URI.create("https://repo1.maven.org/maven2"), false)); + .add(new RepositoryConfiguration("central", URI.create("https://repo.maven.apache.org/maven2"), false)); repositoryConfigurations.addAll(Arrays.asList(additionalRepositories)); DependencyResolutionContext dependencyResolutionContext = new DependencyResolutionContext(); dependencyResolutionContext.addDependencyManagement(new SpringBootDependenciesDependencyManagement());