This guide explains how to publish the Java library to Maven Central.
- Maven Central Account: Create an account at https://central.sonatype.com/
- Maven Central Token: Generate a token from your Maven Central account settings
-
Update Version: Update version in
pom.xml -
Build and Test:
cd libs/java mvn clean test
-
Deploy to Maven Central:
mvn clean deploy -P release
The project includes a unified GitHub Actions workflow for automated releases. To use it:
-
Add secrets to GitHub repository:
MAVEN_CENTRAL_USERNAME: Your Maven Central usernameMAVEN_CENTRAL_TOKEN: Your Maven Central token
-
Create a GitHub release with tag
vX.Y.Z(e.g.,v2.2.0) -
The workflow will automatically build and deploy to Maven Central
- Use semantic versioning:
MAJOR.MINOR.PATCH - Keep version in sync with main project version
- All packages are released together with the same version number
This library has been updated to use the new Maven Central publishing system instead of the legacy OSSRH Nexus repository. The new system:
- Uses the
central-publishing-maven-plugininstead ofnexus-staging-maven-plugin - Automatically publishes without manual staging steps
- Requires token-based authentication instead of username/password
- Does not require GPG signing (signing is handled by Maven Central)