Bintray... The Github of Binaries

Yes, now you have plenty of places to keep your code… you can use Github or you can go for Bitbucket if you want to maintain your code private.

Anyway, what happens if you want to actually share binaries for others to use your libraries and/or applications?

Maven Central is there from long time ago, but… to be honest, deploying something there is like breaking in the Pentagon systems!

Sometime ago I discovered Bintray, and it seemed a good place to store binary repositories with a social touch (someone said Github?)

The place seems to by sponsorized by JFrog makers of Artifactory and… guess what, direct competitors of Sonatype (Maven’s better contributors) that develops the Nexus repository manager over which Maven Central runs.

So I decided to test it myself with two projects of my own. One is Sabina written in Java and built with Gradle and other ( coded in Java and built by Maven.

The free version has a limit of 500MB, not enough to deploy the smallest project of my previous company, but plenty to support Open Source projects though.

Bintray integrates with Maven Central and JCenter which claims to be more complete than Maven’s main repository.

To integrate it with your build process you need to add the following lines to your build script (be aware that you won’t be able to deploy snapshots!):

    apply plugin: 'maven-publish'
    // ...
    configurations {
    // ...
    task sourceJar(type: Jar) {
        from sourceSets.main.allJava

    publishing {
        publications {
            mavenJava (MavenPublication) {

                artifact sourceJar {
                    classifier "sources"
        repositories {
            maven {
                url ''
                credentials {
                    username 'jaguililla'
                    password externalProperty ('.gradle/', 'bintrayPassword')

    // ...

def String externalProperty (String fileName, String propertyName) {
    Properties properties = new Properties ()
    properties.load (project.rootProject.file (fileName).newDataInputStream ())
    return properties.getProperty (propertyName)
  • .gradle/ (this file is created to avoid publishing your API key)
bintrayPassword={your Bintray api key}

And execute: gradle publish

    <id>{bintray repository}</id>
    <name>a meaningful name</name>
    <url>{bintray user}/{project}</url>
  • settings.xml
  <id>{bintray repository}</id>
  <username>{bintray user}</username>
  <password>{your Bintray api key}</password>

And run: mvn source:jar deploy

To include your binaries in Maven you’ve got to request that from their site (using the Web UI).

To me, this is a very good platform to support your Open Source projects, just like Github, Travis CI, Coveralls and all the like. Anyway, prior to deploying to JCenter you have to deploy the source of your project along with your binaries. To do so:

    // ...
    task sourceJar(type: Jar) {
        from sourceSets.main.allJava
    // ...

I hope you enjoyed and… you know, don’t make your users compile your code and deploy your binaries!

comments powered by Disqus