in Updates

Publishing Android Libraries to Maven Central Using Gradle – AnDevCon Boston 2015

by: James Harmon (contact info in etherpad document)

Resources from Presentation:


JCenter is run by Bintray.  Their tagline is:

“Forget about Maven Central”

Artifactory is a good option if you want an internally hosted repository.  JCenter also can provide a private hosted repository.

If you publish to mavenCentral(), it will be available on jcenter() as well.

Sign up for a SonaType Acount (mavenCentral()) or a JCenter account. Jcenter seems to be easier and is the default these day for Android libraries, but this example is for SonaType:

You’ll get an email back from SonaType approving you.

Create and Publish Key

Create PGP Key
gpg -gen-key

Find you Key ID:
gpg –list-keys
Key will look like: XXXXXX/YYYYYYYY <date>
YYYYYYYY is they key ID.

Now that you have the key, you can sign the library.

maven-push.gradle (you can include gradle files, so he separated this out)
Separate gradle file for pushing release and snapshot builds to repository.

Generate a pom.xml file using the ‘maven’ gradle plugin. This is useful for some repositories.

Check out your project’s depdencies using:

./gradlew app:dependencies


_releaseApk - ## Internal use, do not manually configure ##
| \---
| \---
+--- com.jakewharton:butterknife:7.0.1
+--- com.jakewharton.timber:timber:3.1.0
\--- com.arcao:slf4j-timber:2.0
+--- org.slf4j:slf4j-api:1.7.12
\--- com.jakewharton.timber:timber:3.0.1 -> 3.1.0


Plugin for deploying gradle builds to jcenter from Nodova