2018-03-10 06:34:50 +00:00
|
|
|
# Releasing to the Maven Central Repository
|
|
|
|
|
|
|
|
## GPG Keys
|
|
|
|
|
|
|
|
Summary of commands for GPG2 keys preparation...
|
|
|
|
|
|
|
|
Generate key:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ gpg2 --gen-key
|
|
|
|
```
|
|
|
|
|
|
|
|
Publish key on public key server:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ gpg2 --list-keys
|
|
|
|
$ gpg2 --list-secret-keys
|
|
|
|
$ gpg2 --keyserver hkp://pool.sks-keyservers.net --send-keys <key-id>
|
|
|
|
```
|
|
|
|
|
|
|
|
Extract secret key for the Gradle signing plugin:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ gpg2 --export-secret-keys > secring.gpg
|
|
|
|
```
|
|
|
|
|
2021-12-22 01:36:51 +00:00
|
|
|
## Gradle build and publish to Central Repository
|
|
|
|
|
|
|
|
> NOTE: The build has been updated to allow snapshots to be published. These appear to be automatically available.
|
2018-03-10 06:34:50 +00:00
|
|
|
|
|
|
|
Ensure full build passes:
|
|
|
|
|
|
|
|
```bash
|
2021-12-22 01:36:51 +00:00
|
|
|
./gradlew clean build
|
|
|
|
|
|
|
|
BUILD SUCCESSFUL in 8s
|
|
|
|
91 actionable tasks: 91 executed
|
|
|
|
```
|
|
|
|
|
|
|
|
Publish:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ ./gradlew publish
|
|
|
|
|
|
|
|
BUILD SUCCESSFUL in 8s
|
|
|
|
2 actionable tasks: 2 executed
|
2018-03-10 06:34:50 +00:00
|
|
|
```
|
|
|
|
|
2021-12-22 01:36:51 +00:00
|
|
|
The can also be combined:
|
2018-03-10 06:34:50 +00:00
|
|
|
|
|
|
|
```bash
|
2021-12-22 01:36:51 +00:00
|
|
|
$ ./gradlew clean build publish
|
2018-03-10 06:34:50 +00:00
|
|
|
|
2021-12-22 01:36:51 +00:00
|
|
|
BUILD SUCCESSFUL in 16s
|
|
|
|
93 actionable tasks: 93 executed
|
2018-03-10 06:34:50 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Then follow "releasing the deployment" below.
|
|
|
|
|
|
|
|
## Tag and publish on GitHub
|
|
|
|
|
|
|
|
Just a reminder!
|
|
|
|
|
|
|
|
# References
|
|
|
|
|
2021-12-22 01:36:51 +00:00
|
|
|
* http://central.sonatype.org/pages/gradle.html (NOTE: Documentation is out of date)
|
2018-03-10 06:34:50 +00:00
|
|
|
* http://central.sonatype.org/pages/releasing-the-deployment.html
|
2021-12-22 01:36:51 +00:00
|
|
|
* https://docs.gradle.org/current/userguide/publishing_maven.html
|
2018-03-10 06:34:50 +00:00
|
|
|
* For all the other little pieces, Google is your friend. ;-)
|