Automated release to Maven Central with Gradle

Viewed 2325

I'd like to upload my jar to the Maven Central repository using gradle uploadArchives and use it in other projects as a dependency. I've followed this nice tutorial with the result that my jars are uploaded to Sonatype Nexus (see screenshot below).

The 0.1 version of my jar is available; the line

dependencies {compile 'eu.matthiasbraun:Utils:0.1'}

works just fine in the build.gradle file of my dependent project. I released the 0.1 version by clicking the Close and the Release buttons seen in the screenshot. After that I commented on the Jira ticket I had created here and was told that central sync would run every two hours.

It was my understanding that if I now wanted to release the 0.2 version of my jar, I simply would do gradle uploadArchives and change the line in build.gradle` of my dependent project to

dependencies {compile 'eu.matthiasbraun:Utils:0.2'}.

Yet, when I gradle build my dependent project (after two hours) I got the error that the dependency could not be resolved.

Here's my complete build.gradle which uploads my jar to Sonatype Nexus: link.

How can I automate the release of jars to Maven Central using Gradle?

screenshot

3 Answers
Related