Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Publishing new versions to Maven Central

Gabriel Valencia edited this page Oct 14, 2019 · 41 revisions

How to Publish

Overview

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

Prerequisites

IBM Cloud Spring Bind

Clone the ibm-cloud-spring-bind code repository into a local directory.

Sonatype

  1. 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/.
  2. 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.
  3. Visit https://oss.sonatype.org/#profile;User%20Token and click on Access User Token. Note the user token values which will be needed later.

GnuPG (GPG)

  1. 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.
  2. 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.
  3. Modify the ~/.m2/settings.xml file. If you don't have this file, go ahead and run mvn 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>
    
  4. In your terminal, execute export GPG_TTY=$(tty) to fix a known issue encountered when signing the jar.
  5. Execute mvn verify -Dgpg.passphrase=<your_gpg_passphrase> using the passphrase used with the gpg --gen-key command. If it succeeds, you are all set.

Steps

  1. Make sure you've followed the prerequisites (see above).
  2. 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.
  3. 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.
  4. Push your changes to the master branch.
  5. Execute mvn clean deploy -Darguments=-Dgpg.passphrase=<your_gpg_passphrase> to push your changes to the Sonatype repository for staging.
Clone this wiki locally