From 8e457877cb7d156324556d6301072aacdd9b676f Mon Sep 17 00:00:00 2001 From: Rabi Panda Date: Mon, 9 Aug 2021 17:07:43 -0700 Subject: [PATCH] Replace JCenter with Maven Central. (#1057) On February 3 2021, JFrog [announced](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/) the shutdown of JCenter. Later on April 27 2021, an update was provided that the repository will only be read only and new package and versions are no longer accepted on JCenter. This means we should no longer use JCenter for our central artifacts repository. This change replaces JCenter with Maven Central as per the Gradle recommendation - https://blog.gradle.org/jcenter-shutdown Signed-off-by: Rabi Panda Signed-off-by: Marc Handalian --- buildSrc/build.gradle | 3 ++- .../gradle/OpenSearchTestBasePluginFuncTest.groovy | 2 +- .../org/opensearch/gradle/RepositoriesSetupPlugin.java | 2 +- buildSrc/src/testKit/opensearch.build/build.gradle | 4 ++-- buildSrc/src/testKit/testingConventions/build.gradle | 2 +- buildSrc/src/testKit/thirdPartyAudit/build.gradle | 2 +- settings.gradle | 7 +++++++ 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 87195a4ac3d41..a980b2660ffe2 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -94,7 +94,8 @@ tasks.withType(JavaCompile).configureEach { *****************************************************************************/ repositories { - jcenter() + mavenCentral() + gradlePluginPortal() } dependencies { diff --git a/buildSrc/src/integTest/groovy/org/opensearch/gradle/OpenSearchTestBasePluginFuncTest.groovy b/buildSrc/src/integTest/groovy/org/opensearch/gradle/OpenSearchTestBasePluginFuncTest.groovy index bc50791483a57..fb61bbded5e09 100644 --- a/buildSrc/src/integTest/groovy/org/opensearch/gradle/OpenSearchTestBasePluginFuncTest.groovy +++ b/buildSrc/src/integTest/groovy/org/opensearch/gradle/OpenSearchTestBasePluginFuncTest.groovy @@ -53,7 +53,7 @@ class OpenSearchTestBasePluginFuncTest extends AbstractGradleFuncTest { } repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/buildSrc/src/main/java/org/opensearch/gradle/RepositoriesSetupPlugin.java b/buildSrc/src/main/java/org/opensearch/gradle/RepositoriesSetupPlugin.java index 9396d03e4f5c6..30847f0648c5c 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/RepositoriesSetupPlugin.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/RepositoriesSetupPlugin.java @@ -82,7 +82,7 @@ public static void configureRepositories(Project project) { // such that we don't have to pass hardcoded files to gradle repos.mavenLocal(); } - repos.jcenter(); + repos.mavenCentral(); String luceneVersion = VersionProperties.getLucene(); if (luceneVersion.contains("-snapshot")) { diff --git a/buildSrc/src/testKit/opensearch.build/build.gradle b/buildSrc/src/testKit/opensearch.build/build.gradle index be1d34db7d286..a0093eb1d2cd1 100644 --- a/buildSrc/src/testKit/opensearch.build/build.gradle +++ b/buildSrc/src/testKit/opensearch.build/build.gradle @@ -39,7 +39,7 @@ repositories { artifact() } } - jcenter() + mavenCentral() } repositories { @@ -53,7 +53,7 @@ repositories { artifact() } } - jcenter() + mavenCentral() } // todo remove offending rules diff --git a/buildSrc/src/testKit/testingConventions/build.gradle b/buildSrc/src/testKit/testingConventions/build.gradle index 57179bf8407a3..309a9d64d4170 100644 --- a/buildSrc/src/testKit/testingConventions/build.gradle +++ b/buildSrc/src/testKit/testingConventions/build.gradle @@ -18,7 +18,7 @@ allprojects { apply plugin: 'opensearch.build' repositories { - jcenter() + mavenCentral() } dependencies { testImplementation "junit:junit:4.13.1" diff --git a/buildSrc/src/testKit/thirdPartyAudit/build.gradle b/buildSrc/src/testKit/thirdPartyAudit/build.gradle index f323e538a0b87..21b0fc3e74f57 100644 --- a/buildSrc/src/testKit/thirdPartyAudit/build.gradle +++ b/buildSrc/src/testKit/thirdPartyAudit/build.gradle @@ -36,7 +36,7 @@ repositories { artifact() } } - jcenter() + mavenCentral() } dependencies { diff --git a/settings.gradle b/settings.gradle index cd745fa53dd6e..51e50564f991d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,6 +9,13 @@ * GitHub history for details. */ +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + } +} + plugins { id "com.gradle.enterprise" version "3.5" }