Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 1.x] Replace JCenter with Maven Central. (#1057) #1892

Merged
merged 1 commit into from
Jan 13, 2022

Conversation

mch2
Copy link
Member

@mch2 mch2 commented Jan 12, 2022

On February 3 2021, JFrog announced 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 [email protected]

Description

[Describe what this change achieves]

Issues Resolved

#1456

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@opensearch-ci-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@dblock
Copy link
Member

dblock commented Jan 12, 2022

Looks like this is still failing because there's some jcenter dependency leftover.

> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.diffplug.spotless:spotless-lib:2.7.0.
     Required by:
         project : > com.diffplug.spotless:com.diffplug.spotless.gradle.plugin:5.6.1 > com.diffplug.spotless:spotless-plugin-gradle:5.6.1
      > Could not resolve com.diffplug.spotless:spotless-lib:2.7.0.
         > Could not get resource 'https://plugins.gradle.org/m2/com/diffplug/spotless/spotless-lib/2.7.0/spotless-lib-2.7.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/diffplug/spotless/spotless-lib/2.7.0/spotless-lib-2.7.0.pom'. Received status code 502 from server: Bad Gateway
   > Could not resolve com.diffplug.spotless:spotless-lib-extra:2.7.0.
     Required by:
         project : > com.diffplug.spotless:com.diffplug.spotless.gradle.plugin:5.6.1 > com.diffplug.spotless:spotless-plugin-gradle:5.6.1
      > Could not resolve com.diffplug.spotless:spotless-lib-extra:2.7.0.
         > Could not get resource 'https://plugins.gradle.org/m2/com/diffplug/spotless/spotless-lib-extra/2.7.0/spotless-lib-extra-2.7.0.module'.
            > Could not GET 'https://jcenter.bintray.com/com/diffplug/spotless/spotless-lib-extra/2.7.0/spotless-lib-extra-2.7.0.module'. Received status code 502 from server: Bad Gateway
   > Could not resolve com.diffplug.durian:durian-core:1.2.0.
     Required by:
         project : > com.diffplug.spotless:com.diffplug.spotless.gradle.plugin:5.6.1 > com.diffplug.spotless:spotless-plugin-gradle:5.6.1
      > Skipped due to earlier error
   > Could not resolve com.diffplug.durian:durian-io:1.2.0.
     Required by:
         project : > com.diffplug.spotless:com.diffplug.spotless.gradle.plugin:5.6.1 > com.diffplug.spotless:spotless-plugin-gradle:5.6.1
      > Skipped due to earlier error
   > Could not resolve com.diffplug.durian:durian-collect:1.2.0.
     Required by:
         project : > com.diffplug.spotless:com.diffplug.spotless.gradle.plugin:5.6.1 > com.diffplug.spotless:spotless-plugin-gradle:5.6.1
      > Skipped due to earlier error
   > Could not resolve org.eclipse.jgit:org.eclipse.jgit:5.8.0.202006091008-r.
     Required by:
         project : > com.diffplug.spotless:com.diffplug.spotless.gradle.plugin:5.6.1 > com.diffplug.spotless:spotless-plugin-gradle:5.6.1
      > Skipped due to earlier error

@dlvenable
Copy link
Member

dlvenable commented Jan 12, 2022

The build is failing as it tries to load a .module. I'm working on a similar issue in Data Prepper and I've found this can help:

repositories {
  mavenCentral() {
      metadataSources {
          mavenPom()
          ignoreGradleMetadataRedirection()
      }
  }
  maven {
      url 'https://plugins.gradle.org/m2/'
      metadataSources {
              mavenPom()
              ignoreGradleMetadataRedirection()
      }
  }
}

It is telling Gradle to use only Maven POM and not use Gradle .modules. I've noticed a few dependencies in Data Prepper have POM files in Maven Central, but rely on JCenter for Gradle .module files.

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 4d84b5b0f881cf25828eb8f4f128985b63beb4c9
Log 1880

Reports 1880

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 <[email protected]>
Signed-off-by: Marc Handalian <[email protected]>
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 8e45787
Log 1883

Reports 1883

@mch2
Copy link
Member Author

mch2 commented Jan 12, 2022

start gradle check

@mch2
Copy link
Member Author

mch2 commented Jan 12, 2022

This failed again for a different dependency in 1883 -

https://plugins.gradle.org/m2/com/google/guava/guava/25.1-jre/guava-25.1-jre.jar'.

That is also in maven central - looking to see why this didn't go there first...

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 8e45787
Log 1884

Reports 1884

@mch2
Copy link
Member Author

mch2 commented Jan 12, 2022

❌   Gradle Check failure 8e45787 Log 1884

Reports 1884

This is failing bc of bwc tests checking out and failing to compile 1.2.4 - will make PRs there first

@mch2
Copy link
Member Author

mch2 commented Jan 12, 2022

start gradle check

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 8e45787
Log 1887

Reports 1887

@mch2
Copy link
Member Author

mch2 commented Jan 12, 2022

start gradle check

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 8e45787
Log 1891

Reports 1891

@mch2
Copy link
Member Author

mch2 commented Jan 12, 2022

different, unrelated failure this time - trying again...

15:35:02 REPRODUCE WITH: ./gradlew ':server:internalClusterTest' --tests "org.opensearch.cluster.coordination.Zen1IT.testMixedClusterFormation" -Dtests.seed=927E960B0C7DCE40 -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=it -Dtests.timezone=America/Inuvik -Druntime.java=15

@mch2
Copy link
Member Author

mch2 commented Jan 12, 2022

start gradle check

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success 8e45787
Log 1892

Reports 1892

@CEHENKLE CEHENKLE merged commit fc198ed into opensearch-project:1.x Jan 13, 2022
@mch2 mch2 deleted the backport1057 branch January 13, 2022 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants