build: publish to Maven Central (io.iotex) via Central Portal#35
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 verifiedio.iotexnamespace 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 usecentral.sonatype.comandorg.sonatype.central:central-publishing-maven-plugin).What changed
pom.xmlgroupIdmigratedcom.github.iotexproject→io.iotex; version bumped to0.8.1-SNAPSHOT(first Central release will be0.8.1).IoTeX Foundation <support@iotex.io>as developer/organization, and a fixed<scm>block (it previously pointed at the oldiotex-android-sdkrepo).doclint=none,failOnError=false— the code predates strict doclint), GPG signing (--pinentry-mode loopback), andcentral-publishing-maven-plugin(0.11.0,publishingServerId=central,autoPublish=true) all moved into areleaseprofile. Plainmvn packagecontinues to work with no GPG or credentials; the sunset OSSRHdistributionManagementblock is removed..github/workflows/publish.yml(new): triggers on published GitHub release (andworkflow_dispatchwith an optional version input). Sets up Temurin JDK 11 (matching the pom's source/target), generatessettings.xmlwith acentralserver entry and imports the GPG key viaactions/setup-java, stamps the pom version from the release tag (v0.8.1→0.8.1), then runsmvn -B deploy -Prelease -DskipTests.README.md: Maven Central coordinatesio.iotex:iotex-antenna-java:0.8.1are 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 with0.8.1are published only asio.iotex:iotex-antenna-javaon 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:
CENTRAL_TOKEN_USERNAME— user token name generated at central.sonatype.com → Account → Generate User Token, using the account that owns theio.iotexnamespace (the one publishing userop-kt).CENTRAL_TOKEN_PASSWORD— the token password from the same generated user token.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).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-publishesio.iotex:iotex-antenna-java:0.8.1to Maven Central (visible on Central within ~30 min of a successful run).🤖 Generated with Claude Code