Publish Java SDKs automatically

View as Markdown

You can publish SDKs generated in Postman to Maven Central. Automated publishing is supported through GitHub Actions, which can be configured to publish your SDKs whenever a new release is created in your GitHub repository. By default, the predefined workflow creates a new release every time an automatic PR is merged.

You can also publish manually from your local machine. To learn more, see Publish Java SDKs manually.

To publish your SDKs automatically, use Central Portal credentials and GPG signing keys stored in GitHub secrets.

Prerequisites

  • An account at the Central Portal.
  • A groupId under a namespace you can verify (for example, a domain you own or io.github.<user>).
  • A GPG key for signing artifacts.

Register and verify your namespace

To register and verify your namespace, do the following:

  1. In the Central Portal, select Namespaces > Add Namespace and register the groupId you publish under.
  2. Verify ownership and wait for the namespace status to become Verified:
    • For a domain-based namespace (for example, com.example), add the TXT DNS record provided by the portal.
    • For an io.github.<user> namespace, create the public GitHub repository named with the code provided by the portal.

Create a GPG signing key

To create a GPG signing key for CI publishing, do the following:

  1. Generate an RSA 4096 key (passphrase optional for CI use).
  2. Publish the public key to a public keyserver (for example, keyserver.ubuntu.com or keys.openpgp.org) so Maven Central can verify signatures.
  3. Export the private key in ASCII-armored format (including BEGIN/END PGP PRIVATE KEY BLOCK) for the GPG_PRIVATE_KEY secret.
  4. If you set a passphrase, keep it for the GPG_PASSPHRASE secret. If your key has no passphrase, leave GPG_PASSPHRASE unset.

Create a Central Portal user token

To create your Central Portal publishing token, do the following:

  1. Sign in at the Central Portal and select Your account menu > View Account > Generate User Token.
  2. Copy the generated token username and password values. These aren’t your login credentials.

Add required secrets to your GitHub repo

In GitHub, go to Settings > Secrets and variables > Actions > New repository secret. Add the following repository secrets:

  • MAVEN_CENTRAL_USERNAME — Token username from the Central Portal.
  • MAVEN_CENTRAL_PASSWORD — Token password from the Central Portal.
  • GPG_PRIVATE_KEY — Full ASCII-armored private key block.
  • GPG_PASSPHRASE — Key passphrase (omit if the key has none).
  • MAVEN_CENTRAL_USERNAME, MAVEN_CENTRAL_PASSWORD, and GPG_PRIVATE_KEY secrets are all required for publishing. The GPG_PASSPHRASE secret is optional.
  • Common rejection causes include unverified namespace, unsigned artifacts, missing public key publication, or incomplete POM metadata (name, description, url, licenses, developers, scm).
  • Maven Central is immutable: a published version cannot be overwritten or deleted.