https://kotlinlang.org logo
Title
j

Johan Alkstål

09/09/2019, 2:45 PM
What's the difference between mavenCentral and jCenter?
m

Mike

09/09/2019, 2:48 PM
Not really Kotlin related, right? Basically, the main difference is who owns it. Most projects publish to both, but not all. Some will publish to one, and then wait a bit before publishing to other. Overall, generally no difference.
j

Johan Alkstål

09/09/2019, 2:49 PM
I asked because the default Kotlin IntelliJ template uses mavenCentral while I've seen Kotlin examples use jCenter. So being new on the Java platform I felt the need to see if it mattered. 🙂
m

Matteo Mirk

09/09/2019, 2:49 PM
maven central is the original artifact repository, managed by Apache. Jcenter is maintained by Jfrog
c

Casey Brooks

09/09/2019, 3:01 PM
JCenter will also proxy everything in MavenCentral. If an artifact has not been published to JCenter but has only been published to MavenCentral, you can still resolve that artifact from the JCenter repository. But you cannot resolve JCenter-only artifacts from MavenCentral.
1
j

Johan Alkstål

09/09/2019, 3:01 PM
I see. That's useful I guess
c

Casey Brooks

09/09/2019, 3:09 PM
A couple other differences that are worth knowing (especially for enterprise usage): 1) MavenCentral requires all uploaded artifacts to be GPG-signed, to ensure they have not been tampered with. This is optional when publishing to JCenter 2) MavenCentral requires proof that you own the domain used for a groupId. For example, for Jetbrains to publish to the
org.jetbrains.kotlin
groupId on MavenCentral, they must own the
<http://jetbrains.org|jetbrains.org>
domain or have ownership of the subdomain used in the groupId. 3) You can publish artifacts to JCenter and then have them synced to MavenCentral automatically, assuming they still meet the above criteria.
j

Johan Alkstål

09/09/2019, 3:11 PM
Cool @Casey Brooks Thanks
t

Tamas Balogh

09/09/2019, 3:14 PM
Related to @Casey Brooks answer, here is a nice article explaining why all this GPG and domain stuff is required for regular devs by @zsmb https://blog.autsoft.hu/a-confusing-dependency/
TLDL; use mavenCentral when possible!
👍 1