Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JCenter deprecation; impact on Gradle and Android

Should I be worried about JCenter being deprecated?

Why should I migrate my libraries from JCenter to other Maven repositories?

Can I continue to use jcenter() in my Gradle build script?

like image 835
Mahozad Avatar asked Mar 16 '21 08:03

Mahozad


People also ask

Why is gradle using JCenter?

The Gradle Build Init plugin produces build templates that use the JCenter repository to resolve dependencies. In many code examples and documentation, JCenter is used as an example repository. It's very likely that you have builds that rely on JCenter.

What is use of JCenter in Android?

jCenter is the public repository hosted at bintray that is free to use for open source library publishers. It is the largest repository in the world for Java and Android OSS libraries, packages and components. All the content in JCenter is served over a CDN, with a secure HTTPS connection.

What can I use instead of JCenter Android?

To fully migrate away from jcenter() , all we need to do is replace all jcenter() occurrences with mavenCentral() in all build. gradle files. This will ensure all dependencies for every build type are downloaded again.

What is replacing JCenter?

Jcenter() being replaced in mavenCentral() for gradle - by May 1, 2021 - Java - Chief Delphi.

What happened to jcenter () method in Gradle?

The jcenter () method will be removed in the next major release. Gradle has no inherent tie to JCenter or Maven Central, so you can always switch to any other repository of your choice.

Is jcenter read-only now?

JFrog, the company that maintains the JCenter artifact repository used by many Android projects, made JCenter a read-only repository on March 31st, 2021. According to the announcement , JCenter will allow downloads of existing artifacts indefinitely.

What is the latest jcenter update?

JCenter service update JFrog, the company that maintains the JCenter artifact repository used by many Android projects, made JCenter a read-only repository on March 31st, 2021. According to the announcement, JCenter will allow downloads of existing artifacts indefinitely.

What's new in Gradle 7?

Gradle 7.0 will also deprecate the use of jcenter () to resolve dependencies. You will still be able to use JCenter as a repository, but Gradle will emit a deprecation warning. The jcenter () method will be removed in the next major release.


Video Answer


3 Answers

Replace

jcenter()

with this:

mavenCentral()
like image 154
Umar Ata Avatar answered Oct 23 '22 06:10

Umar Ata


Please see the new answer.

Summary: After February 1st, 2022 jcenter() will not work anymore.

According to this Gradle blog post:

Gradle 7.0 will deprecate the use of jcenter() to resolve dependencies.
You will still be able to use JCenter as a repository, but Gradle will emit a warning.
The jcenter() method will be removed in the next major release.

Gradle has no inherent tie to JCenter or Maven Central, so you can always switch to any other repository of your choice.

And according to Android Developers:

JFrog, the company that maintains the JCenter artifact repository used by many Android projects, recently announced the deprecation and upcoming retirement of JCenter.
According to the announcement, JCenter will allow downloads of existing artifacts until February 1, 2022.

Developers who publish artifacts on JCenter should start migrating packages to a new host, such as Maven Central.

So, just make sure that the authors provide their library in other repositories and then update your build scripts to enable downloading from those repositories.
For example, in Gradle use mavenCentral() function to enable getting dependencies from Maven Central repository.

like image 24
Mahozad Avatar answered Oct 23 '22 07:10

Mahozad


The latest update as mentioned here in JFrog's website is the following:

UPDATE 4/27/2021: We listened to the community and will keep JCenter as a read-only repository indefinitely. Our customers and the community can continue to rely on JCenter as a reliable mirror for Java packages.

like image 28
Pericles Karachristos Avatar answered Oct 23 '22 06:10

Pericles Karachristos