The build is already wired for Central. Releasing is a one-time setup
(account + namespace + GPG key) followed by a single mvn deploy per version.
The release profile in pom.xml builds the source jar, javadoc jar,
GPG-signs every artifact, and uploads to the Sonatype Central Portal via
central-publishing-maven-plugin (0.11.0 — older 0.7.x throws a spurious
Unrecognized field "warnings" Jackson error after a successful upload)
(central.sonatype.com — the current system that replaced OSSRH/oss.sonatype.org).
- Go to https://central.sonatype.com and Sign in (GitHub or Google login works).
- That's the account — no separate JIRA ticket like the old OSSRH flow.
- Central Portal → View Namespaces → Add Namespace.
- Enter
ai.hiapi. - The Portal shows a verification key (a random string). Because this is a
domain namespace (
ai.hiapi⇒ the domainhiapi.ai), verify it by DNS: add a TXT record tohiapi.aiwhose value is that verification key.- Host/name:
hiapi.ai(the apex), record typeTXT, value = the key.
- Host/name:
- Back in the Portal, click Verify Namespace. Once DNS propagates (minutes to an hour), the namespace flips to verified and you can delete the TXT record if you like (keeping it is fine too).
Alternative if DNS is a hassle: register
io.github.hiapiaiinstead (verified by GitHub org ownership, no DNS). But that requires renaming every Java package fromai.hiapitoio.github.hiapiaiand changing the Maven coordinates — not worth it when we ownhiapi.ai.
- Central Portal → your account (top right) → Generate User Token.
- It returns a username and password pair (these are NOT your login credentials — they're a scoped token). Copy both.
Central requires every artifact to be GPG-signed, and the public key must be discoverable on a public keyserver.
# Generate a key (RSA 4096, no expiry is fine for a project key).
gpg --full-generate-key
# Real name: HiAPI
# Email: support@hiapi.ai (match the <developer><email> in pom.xml)
# Set a passphrase — you'll need it at deploy time.
# Find the key's long id:
gpg --list-secret-keys --keyid-format=long
# sec rsa4096/ABCD1234EF567890 2026-06-29 ... <-- the part after the slash
# Publish the PUBLIC key so Central can verify signatures:
gpg --keyserver keyserver.ubuntu.com --send-keys ABCD1234EF567890
gpg --keyserver keys.openpgp.org --send-keys ABCD1234EF567890Create ~/.m2/settings.xml (there is none yet on this machine) with the token
from step 3. A template is checked in at settings.xml.template next to this file.
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0">
<servers>
<server>
<id>central</id> <!-- must match publishingServerId in pom.xml -->
<username>TOKEN_USERNAME</username>
<password>TOKEN_PASSWORD</password>
</server>
</servers>
</settings>From hiapi-fullstack/hiapiai/sdk/hiapi-java:
# Sanity check first — normal build + 50 tests, no GPG needed:
mvn clean test
# Release: builds sources + javadoc, signs, uploads to the Portal.
# Pass the GPG passphrase from step 4 (loopback pinentry is already configured).
mvn -Prelease clean deploy -Dgpg.passphrase='YOUR_GPG_PASSPHRASE'What happens:
- Maven builds
hiapi-0.2.1.jar,hiapi-0.2.1-sources.jar,hiapi-0.2.1-javadoc.jar, plus a.ascsignature and checksums for each. - The
central-publishing-maven-pluginuploads the bundle and waits until validation passes (waitUntil=validated). - Because
autoPublish=true(flipped after the manually-reviewed first release), it then publishes automatically — no browser step needed. It syncs to Maven Central: searchable oncentral.sonatype.comquickly, and resolvable fromrepo1.maven.org/ appearing onsearch.maven.orgwithin ~15–30 min.
To go back to reviewed releases, set <autoPublish>false</autoPublish> — the
upload then stops as a draft in Central Portal → Deployments, where you
review and click Publish manually.
- Coordinates are immutable. You can never re-upload
0.2.1; the next fix must be0.2.2. Bump<version>inpom.xml(and the README install snippet) for every release. - Verify the published artifact resolves:
mvn dependency:get -Dartifact=ai.hiapi:hiapi:0.2.1
-
support@hiapi.aiinpom.xml<developers>is a real inbox (or changed). - GitHub repo
HiAPIAI/hiapi-javaexists (the<scm>URL points at it). - Namespace
ai.hiapiis verified in the Central Portal. - GPG public key pushed to a keyserver.
-
~/.m2/settings.xmlhas thecentralserver token. -
mvn clean testis green. - Any stale earlier-version drafts in the Portal Deployments tab are
Dropped first — an older
0.1.0upload from an aborted run must not linger; only the0.2.1deployment should remain before you Publish.