Enjoy Bintray and use it as pain-free gateway to Maven Central

What does it means when some tool or framework has literally dozens of guides, pages long each?maven central dinosaur
It probably means that it is popular, or complicated to use. Usually, both.

That’s the story of Maven Central (a.k.a. Central Repository, a.k.a. repo1, a.k.a. ibiblio). Of course, there is a better alternative nowadays – Bintray is already a super-set of Maven Central, both in terms of UI, UX and content, but Maven Central is still “hardwired” into the super-popular Maven 2. As such, it is being used by many – by Maven users of course, but also by Ivy, and even by Gradle users (those not familiar with Bintray’s ‘jcenter()’ repo yet). That means that you (still) want your package to also end up  there.

But getting it there is painful… *Very* painful.

Maven Central #fail

Click to enjoy the comments 😛

To understand how painful, next time you take a break, here’s a nice old-school text quest.

So, you get the picture. There has to be a better way. Indeed there is. Why don’t you use a proper distribution platform, with easy and intuitive on-boarding, publishing and sharing, with rich near real-time statistics, downloadable logs, packages inclusion, watching and sharing abilities, and much more. You know, Bintray.

Here’s the deal:

First, some simple one-time setup needed to be done.

  1. Register to Bintray and set up auto-signing: Generate yourself a keypair, if you don’t have one. Add it to your profile, and setup your default Maven repo (or a new one) for signing with your GPG key: Bintray can then sign your jars automatically.
  2. Add your Sonatype account under “accounts”. If you don’t have one, follow this procedure (yeah, we know what you are saying when you see it, that’s the last “wtf” in this guide, we promise).
  3. Create and link your package: Import from a GitHub repo or create a new package for your Maven project (multi-module projects can map to a single package). Click on “Add to JCenter” to get your package linked to the largest Java Maven repository on the planet.
  4. Set up Maven up to deploy to Bintray by copy-pasting the pom.xml snippets from “Set me up!” guide, or use the bintray-gradle-plugin.

Now, for each release, it’s easy as 1-2-3:

  1. Deploy: Deploy files to Bintray by running your build tool*.
  2. Publish: Review the build artifacts in Bintray and publish the version files if satisfied. Don’t forget to advertise your new release using a single-click tweet.
  3. Sync: On the version page go to the Maven Central tab (the one with the dinosaur icon on it), enter your Sonatype password and click “Sync” and you’re done! Your package is now in https://oss.sonatype.org/content/repositories/releases and will be synced to Maven Central (and they usually take their time). In case of a sync problem, Bintray will automatically take care of any needed cleanup.

Next, you’ll probably feel the urge to to tweet something like this:

Don’t resist it. You are joining spring, netty, jenkins, joda-time, asciidoctor and many many others that already feel the same way.


* Remember: distribution platform is not for SNAPSHOT-s. Stay tuned for our post about oss.jfrog.org to see how you can get access to a free binary repository with one-click promotion to Bintray.

Bintray + GitHub = Synergistic Love Story

First things first – Bintray is not a competitor of GitHub. They complete each other, not compete. Here’s how (I love vienn diagrams):

Github and BIntray synergy

Click to enlarge

Bintray is an organic next step for developing software at GitHub – once your sources are built – distribute them from Bintray.
Our job is to make it as easy as possible for you, our fellow GitHubber. Here’s what you get:

First, sign up to Bintray using GitHub:
Sign Up

Authorize Bintray for GitHub, fill the needed details, and you’re done.

Naturally, login using GitHub too:
Sign In

Next step is the only one you’ll have to do manually, without GitHub integration – creation of a repository1. Don’t forget to select the right type!

Create Repo

Click to enlarge

Once that done, we are back to GitHub integration again. Just click on Import From Git:

Import from GitHub

Click to enlarge

Get your stuff from to Bintray in two simple steps:

  1. Select the desired GitHub repositories to become Bintray packages2. If you have tags, they can automatically become Bintray versions.

    Import stage 1

    click to enlarge

  2. Next step – get your binaries out of GitHub to the proper binary distribution platform (before they shut the binary hosting down again?). You can select the files and they will be included in your version:
    Import stage 2

Done! Your repository is properly set up with packages, versions and even files from GitHub. Last touches – readme and release notes can also be taken from GitHub (I told you – we’ll set you up!):
Readme from GitHub

Woot! Just couple of clicks and the natural next step in your software lifecycle is ready to host and publish your binaries. Configure your build tool (or, even better, your CI server) to deploy to Bintray, and rock on. Oh, that’s a topic for a whole new blog post. Stay tuned.

Happy publishing!


1 A repository, or “repo”, is a logical unit that serves as a category or grouping of information in which uploaded material and relevant metadata are stored. A repo is a grouping of software material that logically belongs together, according to theme and target audience.

2 The package is the main entity with which Bintray works. Essentially, a package is a module of software that one user uploaded so that others can download it. Contained within a repo, each package is a smaller logical unit for storing a software module or a group of files.