Getting Started
Introduction⚓︎
Alert
If you currently publish to oss.sonatype.org or s01.oss.sonatype.org, please continue to use our original publishers' guide. If you are interested in Publisher Early Access, please send a message to Central Support, so we can walk you through the migration process. Publishing via the existing workflow and the new workflow to the same namespace is not possible, but migrating back to the OSSRH workflow is supported while the Portal workflow is in Early Access.
Publisher Early Access enables you to do the following on https://central.sonatype.com:
- Claim a publishing namespace
- Publish components to Maven Central using a web interface
- Publish components to Maven Central using a Maven build plugin
- Set up a webhook for notifying you when your components have been successfully published
- Manage your credentials
If you are not currently publishing artifacts to Maven Central on an oss.sonatype.org host, and if you are comfortable with manually publishing components on https://central.sonatype.com, then keep reading for a step-by-step guide that takes you through the entire process from signup to uploading your first components!
Publishing Your Components⚓︎
After your namespace has been verified, you're finally ready to start uploading components to Maven Central! See the following documentation for further instructions:
Component Validation⚓︎
After your upload is accepted, Publisher Early Access will begin the validation process:
The validation process ensures that your components meet all the requirements for Maven Central. Validation should not take more than a few minutes. Click the "Refresh" button to see status of the validation process.
If your components do not meet all the requirements, your Deployment will fail, and the right column of the Deployment card, labeled "Validation Results," will detail which validations failed. Once you address those issues in your local build, you can click the "Publish Component" again to start a new Deployment where you can submit the updated zip file.
Once the validation is complete and if there are no errors, you are able to publish your components. Pressing the "Publish" button will sync automatically to Maven Central. Congratulations!
Important
Once released/published, you will not be able to remove/update/modify your components. Please see the Can I change (modify, delete, update) a component on Central? FAQ for more details on this long-standing policy.
Deployments visible on the Deployments Tab will be cleaned up after 90 days.
Adding a Webhook⚓︎
Publisher Early Access enables publishers to specify a webhook, which will fire after components have passed validation and are approved for sync to Maven Central. Publishers can use webhooks to get notified in their messaging systems or to trigger other workflows within their organizations.
To add a webhook, click the "View Webhooks" link in the top-right menu under your username/email address:
Provide the required Webhook URL and, if required, a username and password for our service to send when calling your webhook. Click Save button to save your changes:
If you have provided a valid URL (and optional credentials), your webhook be called as soon as you attempt to deploy a component. The webhook will specify details around the status of publishing.
Webhook request details⚓︎
A request to a Webhook will have the following format:
- a POST request to the given Webhook URL
- a JSON body with the following fields:
Name | Type | Description |
---|---|---|
deploymentId | string UUID (36) | Unique ID of deployment |
deploymentName | string | Name of the deployment |
timestamp | long timestamp | Timestamp of notification to Webhook |
status | string | State of deployment VALIDATED: Deployment was successfully validated PUBLISHING: Deployment is publishing PUBLISHED: Deployment was successfully published FAILED: Validation or publishing failed |
packageUrls | string array | PURLs of deployed components |
centralPaths | string array | URLs to repo1 of deployed components |
Webhook notification known issues
The VALIDATED notification is not send when autoPublish is enabled in central-publishing-maven-plugin. The PUBLISHED notification could be duplicated or could be completely missing, depending on publishing conditions.
Sample of the JSON body send
{
"deploymentId": "abcdefgh-1234-abcd-1234-abcdefghijkl",
"timestamp": 1710000,
"status": "VALIDATED",
"packageUrls": [
"pkg:maven/org.sonatype.central.test/exampl@1.0.0"
],
"centralPaths": [
"https://repo1.maven.org/maven2/org/sonatype/central/test/example/1.0.0/example-1.0.0.pom"
]
}
A sample request that Sonatype makes to a Webhook, represented in CURL.
curl -X 'POST' '<your webhook url>' \
-H 'content-type: application/json' \
-H 'accept: application/json' \
--data-raw '{"deploymentId":"abcdefgh-1234-abcd-1234-abcdefghijkl","timestamp":1710000000000,"status":"VALIDATED","packageUrls":["pkg:maven/org.sonatype.central.test/exampl@1.0.0"],"centralPaths":["https://repo1.maven.org/maven2/org/sonatype/central/test/example/1.0.0/example-1.0.0.pom"]}'