155

Please note that JCenter will switch to readonly mode. Avoid using it. jcenter() will be removed in Gradle 8.0.


From Gradle 1.7 there is a new public repository JCenter.

repositories {
   jcenter()
}

So I want to ask if all JAR files from Maven Central are part of this repository? And if not, from what does the JCenter repository consist of? And is JCenter more reliable from Maven Central as downtime?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Xelian
  • 16,680
  • 25
  • 99
  • 152
  • 3
    Here is everything about the [transition from maven central to jcenter](http://www.technotalkative.com/android-studio-migration-maven-central-jcenter/). – Paresh Mayani Feb 19 '15 at 09:34

5 Answers5

137

jcenter() is similar to mavenCentral(). Have a look at https://bintray.com/bintray/jcenter for more details. The JCenter guys claim that they have a better performance than Maven Central.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Rene Groeschke
  • 27,999
  • 10
  • 69
  • 78
  • 35
    Now in jCenter there is no 1.18.1 version of maven-surefire-plugin, but in MavenCentral this version presents. So it is not pure superset of mavenCentral() – Xelian Jan 06 '15 at 14:53
  • Another example is appengine-api-1.0-sdk: there is [v1.9.22](http://search.maven.org/#artifactdetails%7Ccom.google.appengine%7Cappengine-api-1.0-sdk%7C1.9.22%7Cjar) in MavenCentral, but only [v1.9.17](https://bintray.com/bintray/jcenter/com.google.appengine%3Aappengine-api-1.0-sdk/view) in jcenter. – naXa stands with Ukraine Jun 12 '15 at 10:14
  • 10
    According to the [doc](https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/dsl/RepositoryHandler.html) `jcenter()` points to https://jcenter.bintray.com and `mavenCentral()` to https://repo1.maven.org/maven2 – real_paul Sep 15 '15 at 07:44
  • 9
    @Xelian, as far as I know they're lazy and transparent. So even though it doesn't show that they have the file, you can reference it and it'll serve you properly after lazy-fetching the file from [some other source](https://github.com/bumptech/glide/issues/544). – TWiStErRob Sep 17 '16 at 12:13
  • I have a classpath in my buildscript in: org.javafxports:jfxmobile-plugin:1.3.8 - prior to that is says `jcenter()`. When I google org.javafxports:jfxmobile-plugin:1.3.8 I come to https://bitbucket.org/javafxports/javafxmobile-plugin. it must mean jcenter equals butbucket! – Lealo Oct 10 '17 at 01:05
  • `jcenter()` is super set of `mavenCentral()` – Yousha Aleayoub Oct 30 '17 at 17:00
  • in jcenter, there is no junit 4.12 (upto 4.11 is available only) as of now where as in maven it is available. – Imam Bux Sep 04 '18 at 11:39
  • 3
    Since JCenter shuts down in May 2021, you should use Maven Central instead. – AlBlue Feb 05 '21 at 10:05
  • @AlBlue: Apparently, it will [not shut down completely](https://stackoverflow.com/questions/66651640/jcenter-deprecation-impact-on-gradle-and-android/68176759#68176759), but go into archive mode. – Peter Mortensen Jul 29 '21 at 21:08
22

As mentioned in https://bintray.com/bintray/jcenter:

JCenter is the place to find and share popular Apache Maven packages for use by Maven, Gradle, Ivy, SBT, etc. For the most comprehensive collection of artifacts, point your Maven at: http://jcenter.bintray.com Want to distribute your own packages through JCenter? You can link your package by clicking the "Include My Package" button. And if you're into legacy, you can even synchronize your packages directly to Maven Central.

Also I find a good compare at https://www.jfrog.com/knowledge-base/why-should-i-use-jcenter-over-maven-central/ (unfortunately the link seems dead but some useful hints are here):

jcenter is the public repository hosted at bintray that is free to use for open source library publishers. There are many good reasons to use jcenter over Maven Central. Here are some of the major ones:

  1. jcenter delivers library through CDN which means improvements in CI and developer builds.
  2. jcenter is the largest Java Repository on earth. This means that whatever is available on Maven Central is available on jcenter as well.
  3. It is incredibly easy to upload your own library to bintray. No need to sign them or do any complex things like you have to on Maven Central.
  4. Friendly-UI If you want to upload your library to Maven Central you could do it easily with a single click on the bintray site.
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Alireza Fattahi
  • 42,517
  • 14
  • 123
  • 173
  • This link is dead: https://www.jfrog.com/knowledge-base/why-should-i-use-jcenter-over-maven-central/ and I couldn't find anywhere it had been moved to to update it – Chris R Feb 14 '19 at 10:48
  • 1
    There's no need to search for the link (as I just did on the wayback machine) because Alireza has copied the text from the linked page into his answer. – JL_SO Nov 14 '19 at 08:31
  • Since JCenter shuts down in May 2021, you should use Maven Central instead. – AlBlue Feb 05 '21 at 10:04
  • The first link is (effectively) broken (redirects to `https://jfrog.com/distribution/?bintrayRD=1`). – Peter Mortensen Jul 29 '21 at 21:10
13

New answer:

JCenter will shut down so this question will be moot. Just use Maven Central

Old answer that applied before May 2021:

Maven Central and JCenter are mostly equivalent, from a user perspective.

The reason there are two big repositories is that Maven Central is backed by Sonatype, the company behind Maven and especially behind Nexus, a Maven repository they sell to enterprises.

JCenter is backed by JFrog, the company behind Artifactory, a competitor to Nexus. From what I remember, JFrog also backed Gradle for a while, as a competitor to Maven.

So in the end it's about competing companies offering free services to try to lure customers to their higher level enterprise offerings.

Unless you have a very specific reason to use one of them, you can basically toss a coin to choose one.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
oblio
  • 1,519
  • 15
  • 39
  • Since JCenter shuts down in May 2021, you should choose Maven Central instead. – AlBlue Feb 05 '21 at 10:04
  • The answer ought to be as if it was written today (the revision history keeps the old version). Outdated information ought not be part of the current answer. – Peter Mortensen Jul 29 '21 at 21:13
8

JFrog have announced that from the start of May 2021 Bintray, JCenter etc. will be deleted and no longer used. If you are using JCenter with Gradle, you should migrate to using MAven or another appropriate repository instead.

You should consider doing builds for applications that might use assets in order to download them, because there will likely be assets that aren’t available anywhere else after the shutdown and they may not be recoverable.

https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/

AlBlue
  • 23,254
  • 14
  • 71
  • 91
  • I've written up more details on my InfoQ post as to how it will affect users: https://www.infoq.com/news/2021/02/jfrog-jcenter-bintray-closure/ – AlBlue Feb 05 '21 at 10:00
  • Apparently, JCenter will [not be deleted](https://stackoverflow.com/questions/66651640/jcenter-deprecation-impact-on-gradle-and-android/68176759#68176759). It will go into archive mode. – Peter Mortensen Jul 29 '21 at 21:15
1

jCenter() contains artifacts that don't exist in mavenCentral() for example com/bmuschko/gradle-cargo-plugin/2.2.3/gradle-cargo-plugin-2.2.3.jar

jpllosa
  • 2,066
  • 1
  • 28
  • 30
  • 1
    The gradle-cargo-plugin is available in Maven Central now https://search.maven.org/artifact/com.bmuschko/gradle-cargo-plugin – AlBlue Feb 05 '21 at 10:04