Skip to content

How to release with Bintray

Alexey Alekhin edited this page Sep 9, 2017 · 5 revisions

Release with Bintray

Releasing to Maven Central

Bintray allows you to synchronize your releases with Maven Central, so that every time you publish a package you can also send it to Maven Central and make it available to the world.

This feature is optional, but enabled by default for releases via tag. If you only want to sync Maven Central for stable releases, don't change this setting.

If you want to disable synchronize to Maven Central, scope this at the project or global level:

// build.sbt
releaseEarlyEnableSyncToMaven := false

If you want to synchronize to Maven Central for all the versions, change it to:

// build.sbt
releaseEarlyEnableSyncToMaven := true

Steps to set up the synchronization

  1. Create a Maven Bintray repository.

    bintray_maven

  2. After you have released your first package, ever, synchronize your Bintray package with JCenter.

    jcenter-to-link

Then, the following will happen:

  1. The Bintray team will accept your package into the JCenter repository (~1-2 hours).
  2. You will get a notification when your package can be synchronized to Maven Central, like:

jcenter

After these manual steps, releaseEarly will do its job. If gpg keys are accessible to the CI and releaseEarlyEnableSyncToMaven is true, synchronization to Maven Central will happen every time you execute releaseEarly.

Disadvantages

Bintray has several disadvantages:

  1. It requires an extra account.
  2. Synchronizing to Maven Central requires a Sonatype account and is done per package, meaning that if you want to synchronize to Maven Central several packages you'll need to ask for permissions for each one. This takes up some non-negligible time.
  3. You cannot synchronize sbt plugins to Maven Central because they do not support permissive layouts. Related issues here and here. The Bintray team has said that they will fix it but it has not promised a timeline.
  4. Requires the setup of specific Bintray resolvers.

Read up on Sonatype's disadvantages if you're interested to see how it fares.