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.

19 thoughts on “Enjoy Bintray and use it as pain-free gateway to Maven Central

  1. Your biggest problem, as I see it, is your poor record supporting users. I tried using JFrog for years and got absolutely no response for legitimate bug reports. This doesn’t speak well for Bintray or any other project you would like the community to adopt (and yes, Bintray is a great idea!)

    • Thanks for your input. There is no such product “JFrog”, with or without bugs 🙂 I guess you refer to Artifactory when mention “tried using JFrog for years”? We are very surprised to hear that. Our customer support is one of the things we are most proud of (and our retention rate proves that).
      We’ll be glad to get any references for the unsolved problems you had. If you have any JIRA liks for the reported and non-responded bugs, please bring our attention to them.

      Thanks again for this comment.

      • Sorry yes. Artifactory 🙂 and in retrospect, it isn’t as bad as I remembered it being.

        If you go into the issue tracker and query all issues reported by “cowwoc” you will find 7 issues. 4 were resolved, 3 are outstanding. My main complaint is that the outstanding issues received no reply for over 6 months. I’m not necessarily expecting issues to get fixed right away, but at the very least there should be follow-up to confirm whether you can reproduce the bug and/or plan to fix it in the future.

  2. Thanks for reporting the issues in our JIRA. The reason the issues are unanswered is that we do not communicate with our users using the JIRA comments (nor by blog comments BTW 🙂 ). There are much better channels, like the forum, the user-list and the customer support, of course. You are more than welcome to use one of them, and your query won’t remain unanswered, guaranteed.

  3. Pingback: Distribute project’s artifacts in Maven Central with OSSRH | Rule of Tech

  4. Pingback: Android Studio - Migration from maven central to jcenter

  5. Pingback: Android Studio – Migration from Maven Central to JCenter | Blog @Bintray

  6. Pingback: Android Studio – Migration from Maven Central to JCenter | Indie Game Developer!

  7. Pingback: Android Studio – Migration from Maven Central to JCenter | Ceiba3D Studio

  8. The trickiest part of Sonatype is the setup, and you still require that. I’m not sure what Bintray buys me really. I got through Sonatype setup pretty quickly but am struggling with Bintray. I’m going to try one repo, but so far I’m not optimistic.

    • Bintray for sure does not require any setup with Sonatype. Bintray by itself is much more advanced repository, both feature-wise and secutiry-wise. As a courtesy we provide a sync to a legacy repository since it’s hardcoded in Maven. All the modern dependency managers like Gradle, SBT, Ivy etc. can and should use Bintray directly instead of Maven Central.

      • Is there a write up of using it without that step? The how-to I found, implied it was needed. Between that and it seemingly requiring the private side of my key I went no further. I’d like to give it a try though and would be pleased it those first impressions proved wrong.

      • I am sorry for the confusing message here. I’ll try to make it more clear.
        Bintray is a distribution platform by its own merit and has nothing to do with Maven Central.
        Also, it uses a totally different trust model than Maven Central, so gpg signatures aren’t mandatory for publishing on Bintray.

        Publishing on Bintray gives access to your packages from any build tool, including Maven, so you don’t really have to publish to Maven Central. Users of Gradle, Ivy and SBT have a special syntax for Bintray, other tools that can use Maven-style repos can add Bintray as a one-liner (e.g. Lineingen). Maven users can, of course, use Bintray as well, by adding it to the settings.xml.

        Since Maven is hard-coding Maven Central and there is no simple way to replace it, a lot of producers feel that they still need to publish to Maven Central as well. Bintray gives them this option, trying to minimize the pain that comes with the process. For example, you don’t need to inherit from Sonatype POMs. You don’t need to use Maven release or Nexus plugins. You don’t need to login to oss.sonatype.org to manually click through stage–close-release-drop buttons. We also provide an option to sign the packages for you. Not because we force you to sign them (as I mentioned earlier, Bintray does not require gpg signatures, we establish trust in other way), but because we want to help you with the Maven Central process. If you want that help, you provide us with your keypair, but not with the passphrase. Then you have a simple REST API to sign your packages without compromising on the integrity of your keypair. Again, this is purly optional. If you don’t trust the gpg passphrase protection, that’s fine! You can always sign on the client side and upload the signature files along the binaries.

        So, the basic idea is – we do whatever we can to help you with Maven Central. But there are aspects that we can’t automate for Sonatype. The ridiculous process of manual JIRA-based on-boarding can’t be automated, no matter what we do.

  9. Thanks for the article. One thing I dont get is that you list for setup point number 3 that you should create the package on bintray – this however duplicates the package config info you have to add to the gradle bintray plugin which seems quite verbose. I would expect if you have already created the package that you should just be able to use the gradle plugin to upload to that package.

    • The rationale of creating the empty package in beforehand is giving you the ability to take advantage of oss.jfrog.org to work your way to the release (also you work with Artifactory plugin then, not Bintray).
      If you prefer not to use the oss.jfrog.org proposition, feel free to create the package on the fly during your first release publication without the bother of creating the package manually in advance.

  10. Pingback: lmm comments on "Code.google.com was shut down, Go packaging is broken"

  11. In terms of artifacts, what does it mean that “JCenter is a superset of Maven Central”? Which other repositories are included (proxied) in JCenter? Thanks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s