Make sure that you have permissions to publish in Yubico’s Sonatype group.
Make sure that you put your credentials into:
> ~/.gradle/gradle.properties
Example gradle.properties:
signing.gnupg.executable=gpg signing.gnupg.keyName=<your_gpg_key_id> sonatype.username=<your_username> sonatype.password=<your_password>
Make sure that you have the desired library version values in the top level
> build.gradle
example:
subprojects { version = '1.0.0-SNAPSHOT' }
Suffix -SNAPSHOT allows you to deploy different version on top of what was already deployed.
As a dry run, publish to your local Maven repository ($HOME/.m2/):
./gradlew publishToMavenLocal
Run this command in Terminal to push to Sonatype staging repository:
./gradlew publish
Publishing can also be done for a single module:
./gradlew modulename:publish
When publishing to Sonatype you will need to log in to the staging repo to close and release.
When building release, gradle will by default execute signing tasks. When this is not desired, for
example during CI builds, it is possible to disable signing with NO_GPG_SIGN
env variable set to true
.
NO_GPG_SIGN=true ./gradlew publishToMaven