Search code examples
gradlemaven-centralgradle-pluginbintrayjcenter

Publishing OSS library release to jcenter and maven-central


I'd like to publish my OSS library to be available in both jcenter and maven-central repositories. I have 2 questions related with this topic:

  1. Should I publish by my own to both repositories, or there is some automated sync between them, so will be enough to publish only to one of them? If there is a sync, which one is the primary source and which when is mirrored?

  2. I'd like to perform publish automatically from gradle, using some gradle plugin. Is there any single plugin, being able to work with both repositories?


Solution

    1. JCenter is a super-set of Maven-Central and it syncs automatically with the package published to Maven-Central, so essentially artifacts published to Maven-Central will be automatically synced and available in JCenter as well.
    2. Gradle has two plugins supporting publishing to several repositories types, including Maven-Central and JCenter: (1) A "legacy" maven plugin and (2) a new incubating maven-publish plugin.