-
Notifications
You must be signed in to change notification settings - Fork 0
Release instructions
Namespace fi.protonode
was created in Maven Central for being able to publish packages.
The request for reserving namespace was done via Jira issue https://issues.sonatype.org/browse/OSSRH-81823.
build.gradle
was set up for publishing and signing, according to Maven Central requirements.
GPG key for signing packages must be available and published in GPG keyserver(s).
The GPG key ID and Sonatype OSSRH (OSS Repository Hosting) credentials must be configured in ~/.gradle/gradle.properties
as following:
signing.gnupg.keyName=<KEY ID> # Find id with "gpg --list-keys"
signing.gnupg.executable=gpg
ossrhUsername=<USER NAME>
ossrhPassword=<TOKEN>
Note that USER_NAME is not your login user name. Both user name and token are generated by following steps:
- Login to https://s01.oss.sonatype.org/.
- Click
Profile
in upper right corner of the page. - Select
User token
from drop-down menu.
Snapshots can be published for testing the release process or for making unreleased package available for users to download for other reasons.
Follow the steps to publish a snapshot:
- Check that
version
number ingradle.properties
has-SNAPSHOT
suffix. - Run
gradle publish
to deploy. GPG passphrase will be prompted for signing.
Snapshots are NOT synchronized to Maven Central Repository.
Therefore, to use snapshots as dependency for a project, the snapshot repository URL must be added to the project.
If using gradle it is done by adding following into build.gradle
:
repositories {
maven {
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
mavenContent {
snapshotsOnly()
}
}
}
Snapshot release will be available at https://s01.oss.sonatype.org/content/repositories/snapshots/ immediately. Same version can be published multiple times. Latter publish overwrites the previous version.
⚠️ Warning: Package cannot be deleted or replaced after promoting it to release from staging!
Follow the steps to publish release to Maven Central https://repo1.maven.org/maven2/:
- Update the to-be-released version number in
gradle.properties
by removing-SNAPSHOT
and commit that as to-be-released version:git add gradle.properties && git commit -m "Updated for release vX.Y.Z"
. - Tag the release
git tag vX.Y.Z
. - Run unit test
gradle test
. - Run
gradle publish
to deploy. GPG passphrase will be prompted for signing. - Login to https://s01.oss.sonatype.org/ to promote the upload to release.
- Click Staging repositories and check that uploaded files look OK. The package might take a while to appear in the staging list. If nothing got uploaded, re-generate user token in Profile and update
~/.gradle/gradle.properties
. - Click
Close
to proceed orDrop
to delete the staging repository if something went wrong. - Wait for the checks to run. Click
Refresh
to update the status. The package may disappear from staging repository for a while during wait. - Click
Release
once successfully closed. Files will appear in this directory after a delay. - Update
gradle.properties
for the next development version by stepping the version number and including-SNAPSHOT
suffix.git add gradle.properties && git commit -m "Updated for next snapshot version"
. - Push changes
git push && git push --tags
. - Create github release by submitting form at https://github.com/tsaarni/java-certy/releases/new.
How long will it take for the package to be synchronized to Maven Central Repository? From the Jira ticket at the time when ordering the namespace:
Your component will be available to the public on Central https://repo1.maven.org/maven2/, typically within 30 minutes, though updates to https://search.maven.org can take up to four hours.
- Requiremements for packages to be published at Maven Central https://central.sonatype.org/publish/requirements/.
- Instructions for releasing at Sonatype OSSRH https://central.sonatype.org/publish/release/.
- Getting started guide for Sonatype OSSRH https://central.sonatype.org/publish/publish-guide/.