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.

Increase your package visibility, the social way!

So, your binaries are hosted on Bintray and you are watching your package download stats grow.
It’s time for a boost!
Two great new features online today; they might be small but they are powerful in spreading the word about your packages, or packages you like.

The Latest Download Image

Add a Download Link badge to your GitHub or Bitbucket ReadMe’s using our new Latest Download Image generator.
This will create a badge showing a download button, linking to the latest version of your package.
Currently we support: Markdown and Asciidoc, or plain old HTML.
Latest Version Download Badge

The Version Notification 

Visit any package hosted on Bintray and you will now find a “version notification link” badge that you can copy-paste to your website / blog / email.
Version Notification Link Badge
When your visitors click the badge, Bintray will encourage them to Watch the package, in Bintray’s usual friendly, non-obtrusive kind of way.
 
Watch alert - after clicking a version notification badge
Enjoy…

Tracking New Java Libraries Has Never Been Easier!

Want to know when a new version of $YourFavoriteJavaLibrary is released (and I mean – any Java library)? With Bintray, it’s one-two-three.

  1. Go to bintray.com and search.

    Search Bintray

    Click to enlarge

  2. Click on the package you’d like to watch.

    Bintray Smart Sorting

    Click to Enlarge

  3. Click “watch”, (log in if needed).

    Bintray Watch Package

    Click to Enlarge

  4. Done.
  5. Watch your mailbox, you’ll get an email.

    Bintray Email Notification

    Click to Enlarge

It can’t be simpler than this, can it? 🙂

P.S. Of course, this functionality is not limited to Java packages only. Any binary in Bintray can be watched for new versions.

Fight Crime with GPG

So you deliver your awesome library to hundreds of users each day, but they’re a tough bunch and they’re all like:

“Hey man, we gotta see some ID”

So you kneel to the whims of the rabble; you generate your GPG key pair and sign each artifact you deliver, because hell if you’re gonna let someone miss out on your superb code

And let there be no mistake – this road means pain, brother.
Wanna use some organization-wide key pairs? How do you plan to safely share them around?
Wanna make sure all products are properly signed? Good luck configuring each and every of your hundred or so builds!

But this is where Bintray swoops in like The Dark Knight, man! To save you from those GPG signing street gangs!
Because unlike the technological promises made by the second millennium (flying cars and whatnot), Bintray took an oath and will do anything it can to help you deliver!

Damn straight; Bintray can now (optionally, only if you want it to!) manage your GPG keys and sign your Maven artifacts for you, so that you have proof about the authenticity of your goods.
All you’ve got to do, is generate your GPG key pair and associate it with a subject (be it your user or your evil organization):

keys

Your public key will be available for others to download right from your public profile page.

Select a repository signatory:
privatekey
And you’re good to go.
Sign artifacts by deploying through the UI or by using one of the available REST-API commands.

“But Bintray,”

you might ask,

“How can I trust you with my keys?”

“Well son, we here are good people… “

Bintray might answer; but it won’t, because it’s not a sentient being.
But you know what’s better than sympathetic answers? actions!
Bintray also supports password protected key pairs; this means that by issuing a single command over a secure HTTPS connection, you can sign your precious artifacts using a pass-phrase. In any case, we encrypt your private key. It’s safe with us.

Update

Still don’t trust us with your keys? It’s cool, we understand; the world is a dangerous place and we’ve still got you covered!
Bintray now keeps a stock built-in key-pair so that it can auto-sign every file you upload.
To apply, edit your repository’s settings and select GPG sign uploaded files using Bintray’s public /private key pair:
atuosign

So there you have it; enjoy another revision of this fine binary distribution platform.
Peace out

Be the First to Know. Really.

So, you have an early-2000 style repository, like Maven Central:
central

And let’s say you are very, extremely interested to know when the new version of netty comes out.  We understand, it’s a natural addiction. How can you do it? Here are some ideas:

  • Well, you can visit Maven Central every day. Couple of times a day.
  • Oh, they have an RSS feed (did we mention early-2000?) It will notify you for everything being published to Maven Central. Well, probably you’ll spend all day reading those notifications, but eventually your eye might catch the project update you are looking for. You could also use Google Reader to filter the RSS stream for you… Oh, wait…
  • Another idea! You can use their REST API. Just a simple query directly on their Solr will produce you a nice JSON file of 109 lines, and by a trivial parsing you’ll find the latest version. Now compare it with what you saw last time you ran the query, and you’ll know about new version in no time.
  • Oh, here’s another neat idea – you can use C4C Firefox plugin or maybe its counterpart for Chrome to get notified. It’s 5 minutes setup. Maybe 10. For each package. Not a big deal, really.

OK, sarcasm aside, that’s how you really can subscribe to notifications without hassle:

Email notifications

  1. Register to Bintray.
  2. Subscribe to netty release notifications:
    watch
    3. Get notification on new netty release to your inbox!
    notification

Hm, how cool n’ simple is that?!

Twitter notifications

Here’s another flow for you:

  1. Follow the publisher on twitter.
  2. Chances are the publisher will tweet about the new release using the twitter button:
    tweet button
  3. Here’s your notification in your twitter feed (that’s not a real one, but you got the idea)!
    tweet

Frankly, We aren’t even sure which way is cooler. Try both!

Webhooks

Now pretend that you are a robot (or that you write software and love to automate things). You want an API to be triggered upon new version? No problem, sir! Register a webhook to get a REST callback when a new version of a package you are interested in is released!

So, with Bintray you are always in the know about packages you care about! Just grab them once they published.

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.