Skip to main content

Maven Central

Publish a prepared, signed Maven Central bundle through the Central Publisher API. Select the directory containing pom.xml or pass that file directly. Central Publisher API

Prepare the bundle​

Build and sign the release before running Releaser. If you use Sonatype's Maven plugin, set skipUpload to prepare target/central-publishing/central-bundle.zip locally. The plugin guide covers metadata and signing prerequisites. Maven plugin

Use a single-component ZIP32 bundle of up to 256 MiB. The project POM and the POM in the ZIP must agree on the literal top-level groupId, artifactId, version, and packaging. Use concrete release versions with ASCII letters, digits, underscores, dots, or dashes, and jar or pom packaging. For jar include the main, sources, and Javadoc JARs. Put the artifacts in their Maven repository paths and include the .asc, .md5, and .sha1 files for each artifact and the POM. Central validates the signature, checksums, and release metadata during deployment. Central bundle layout

You can also include classified .zip and .tar.gz attachments at the same coordinates, such as artifactId-version-source-release.zip. Include the signature and required checksums for each attachment. Apache release profile

Configure the Portal​

ecosystems:
maven:
enabled: true
centralBundlePath: target/central-publishing/central-bundle.zip
registries:
- name: central
url: https://central.sonatype.com
authEnv: YOUR_CENTRAL_TOKEN_VARIABLE

Keep every Maven setting literal. Set the variable named by authEnv to the Portal token pair in username:password form. Releaser encodes the pair in the Bearer authorization header and sends it to the selected origin's upload and status endpoints. Use an HTTPS origin for a compatible Portal, or a loopback IP with HTTP for local fixtures. Central Publisher API authentication

Validate and publish​

release validate path/to/project --ecosystem maven
release publish path/to/project --ecosystem maven --registry central --dry-run
release publish path/to/project --ecosystem maven --registry central

Validation and dry runs read the project POM and ZIP locally. Releaser checks ZIP entry lengths and CRCs, matches the supplied checksums to the archive bytes, and parses the detached OpenPGP signatures before reading publication credentials. Publishing sends the checked ZIP bytes unchanged. With publish.dryRunFirst, the preview and upload use the same checked ZIP. These commands work without Maven installed. For a version change, edit the POM and prepare a new bundle.

Read the deployment state​

Releaser requests automatic publication. It checks the new deployment up to three times, one second apart, with a five-second timeout per status request. publish.verify: false reports ACCEPTED with the deployment ID and skips the status requests. Central deployment states

StateExit codeMeaning
PUBLISHED0Central confirmed publication for this deployment ID.
ACCEPTED, PENDING, VALIDATING, VALIDATED, PUBLISHING0Central accepted the upload. Use the printed deployment ID to follow it in the Portal. VALIDATED can require action in the Portal.
FAILED, UPLOAD_REJECTED1Central reported a failed deployment or rejected the upload. Use the deployment ID to review a failed deployment in the Portal.
UNKNOWN1Releaser could not confirm upload acceptance or retrieve the deployment state. Check the Portal by deployment ID when available, or by release coordinates, before rerunning publish.