This repository was archived by the owner on Feb 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Publishing new versions to Maven Central
Gabriel Valencia edited this page Oct 14, 2019
·
41 revisions
The IBM Cloud Spring Bind Maven artifact is published via Sonatype. Read through this page and watch the linked videos on it to become familiar with the process of becoming a producer on Sonatype:
https://central.sonatype.org/pages/producers.html
Clone the ibm-cloud-spring-bind code repository into a local directory.
- Create a new account at https://issues.sonatype.org/. Important: Make sure to use your work ibm.com email address. You will use those same credentials to publish the artifact at https://oss.sonatype.org/.
- Create a ticket to get access to the IBM Cloud Spring Bind OSSRH repository at https://issues.sonatype.org/secure/CreateIssue!default.jspa. Change the issue type to Task, write a summary like
Need access to ibm-cloud-spring-boot-service-bind
and note the current repository owner is Paul Bennett. - Visit https://oss.sonatype.org/#profile;User%20Token and click on Access User Token. Note the user token values which will be needed later.
- Install GnuPG which is used to sign the jar. On a Mac with Homebrew, execute
brew install gnupg
. Or visit https://gnupg.org/download/ to download binary releases. - Follow this page to get it set up to sign the jar: https://central.sonatype.org/pages/working-with-pgp-signatures.html. Make sure you follow the sections to generate a key and distribute your public key. Important: Remember or write down the passphrase for your key in a secure place. You will need it when deploying artifacts to Sonatype.
- Modify the
~/.m2/settings.xml
file. If you don't have this file, go ahead and runmvn clean install
on the IBM Cloud Spring Bind project to generate it. Add the following to the<servers>
section, replacing with your Sonatype OSSRH user token values:<server> <id>ossrh</id> <username>[email protected]</username> <password>your_ossrh_user_token:value</password> </server>
- In your terminal, execute
export GPG_TTY=$(tty)
to fix a known issue encountered when signing the jar. - Execute
mvn verify -Dgpg.passphrase=<your_gpg_passphrase>
using the passphrase used with thegpg --gen-key
command. If it succeeds, you are all set.
- Make sure you've followed the prerequisites (see above).
- Make necessary code changes in your local ibm-cloud-spring-bind code repository and test with
mvn clean install
. Add new unit tests as needed. - Update the
pom.xml
file by increasing the<version>
tag value. Use a standard Major.Minor.Patch scheme and change the specific version appropriately. Also add yourself to the<developers>
section if you are not already there. - Push your changes to the master branch.
- Execute
mvn clean deploy -Darguments=-Dgpg.passphrase=<your_gpg_passphrase>
to push your changes to the Sonatype repository for staging.