Enjoy Bintray and use it as pain-free gateway to Maven Central
Join the DZone community and get the full member experience.Join For Free
does it means
when some tool or framework has
literally dozens of guides
, pages long each?
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.
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, which 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.
- register to bintray and set up an auto - signing: generate yourself a keeper, 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 .
- 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).
- 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 .
- 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:
- deploy: deploy files to bintray by running your build tool * .
- 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.
- 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.
Opinions expressed by DZone contributors are their own.