Skip to content

build: publish to Maven Central (io.iotex) via Central Portal#35

Merged
guo merged 4 commits into
masterfrom
feat/maven-central-publishing
Jul 10, 2026
Merged

build: publish to Maven Central (io.iotex) via Central Portal#35
guo merged 4 commits into
masterfrom
feat/maven-central-publishing

Conversation

@raullenchai

Copy link
Copy Markdown
Member

Why

This SDK has only ever been consumable via JitPack (com.github.iotexproject:iotex-antenna-java), never published to Maven Central. Consumers whose build infrastructure only mirrors Maven Central (e.g. Binance) cannot resolve JitPack coordinates at all. IoTeX already owns the verified io.iotex namespace on Sonatype (userop-kt publishes there), so this PR wires the repo to publish there through the Central Portal (OSSRH is sunset; new publishing must use central.sonatype.com and org.sonatype.central:central-publishing-maven-plugin).

What changed

  • pom.xml
    • groupId migrated com.github.iotexprojectio.iotex; version bumped to 0.8.1-SNAPSHOT (first Central release will be 0.8.1).
    • Central-required metadata completed: license (Apache 2.0, matching the README badge and the existing pom declaration), IoTeX Foundation <support@iotex.io> as developer/organization, and a fixed <scm> block (it previously pointed at the old iotex-android-sdk repo).
    • Source-jar, javadoc-jar (doclint=none, failOnError=false — the code predates strict doclint), GPG signing (--pinentry-mode loopback), and central-publishing-maven-plugin (0.11.0, publishingServerId=central, autoPublish=true) all moved into a release profile. Plain mvn package continues to work with no GPG or credentials; the sunset OSSRH distributionManagement block is removed.
  • .github/workflows/publish.yml (new): triggers on published GitHub release (and workflow_dispatch with an optional version input). Sets up Temurin JDK 11 (matching the pom's source/target), generates settings.xml with a central server entry and imports the GPG key via actions/setup-java, stamps the pom version from the release tag (v0.8.10.8.1), then runs mvn -B deploy -Prelease -DskipTests.
  • README.md: Maven Central coordinates io.iotex:iotex-antenna-java:0.8.1 are now the primary install path (no extra repository needed); JitPack kept as a short legacy section for older tags/commits.

Migration note for existing users

The groupId changes with this release. JitPack coordinates (com.github.iotexproject:iotex-antenna-java) keep working for existing tags/commits, but new versions starting with 0.8.1 are published only as io.iotex:iotex-antenna-java on Maven Central. Update your dependency coordinates when upgrading.

Maintainer action required

Add these 4 repository secrets (Settings → Secrets and variables → Actions) before cutting a release:

  1. CENTRAL_TOKEN_USERNAME — user token name generated at central.sonatype.com → Account → Generate User Token, using the account that owns the io.iotex namespace (the one publishing userop-kt).
  2. CENTRAL_TOKEN_PASSWORD — the token password from the same generated user token.
  3. GPG_PRIVATE_KEY — ASCII-armored GPG private key for signing (gpg --armor --export-secret-keys <KEYID>); the public key must be published to a key server (e.g. keyserver.ubuntu.com).
  4. GPG_PASSPHRASE — passphrase of that GPG key.

Release flow: merge this PR → create a GitHub release with tag v0.8.1 → the workflow builds, signs, and auto-publishes io.iotex:iotex-antenna-java:0.8.1 to Maven Central (visible on Central within ~30 min of a successful run).

🤖 Generated with Claude Code

raullenchai and others added 4 commits July 9, 2026 20:39
- pom.xml: migrate groupId com.github.iotexproject -> io.iotex, bump
  version to 0.8.1-SNAPSHOT, fix the scm block (pointed at the old
  iotex-android-sdk repo), set IoTeX Foundation as developer/organization
- move source/javadoc/gpg/central-publishing plugins into a 'release'
  profile so plain 'mvn package' needs no GPG setup; publish through
  org.sonatype.central:central-publishing-maven-plugin (Central Portal,
  publishingServerId=central, autoPublish) replacing the sunset OSSRH
  distributionManagement
- add .github/workflows/publish.yml: on published release (or manual
  dispatch) stamp the version from the tag and 'mvn deploy -Prelease'
  with Central Portal token + GPG key from repo secrets
- README: Maven Central coordinates io.iotex:iotex-antenna-java as the
  primary install path; keep JitPack as legacy alternative

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
README's license badge previously linked to a non-existent LICENSE file.
Compile + package on push/PR to verify build health. Integration tests
that require a live IoTeX node are skipped to keep CI hermetic.
web3j:crypto:4.13.0 (used by EthTypedTxSigner for typed-tx / RLP
signing) is compiled for Java 17, so the project cannot build on
JDK 11. Bump maven-compiler source/target to 17 and both CI
workflows (build + publish) to JDK 17. The SDK now requires a
Java 17+ runtime, which was already effectively the case via web3j.
@guo guo merged commit d86c794 into master Jul 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants