Maven Central FAQ
This page is not directly related to Nmcp but lists some of the frequently asked questions about Maven Central that arose during the development of this plugin.
Q: Do I need to migrate my account?
If your account was created after March 12th 2024, it uses https://central.sonatype.com/ by default, and you can use this plugin directly.
If your account was created before, and you used to log in to https://oss.sonatype.org or https://central.sonatype.com/, you now need to login to https://central.sonatype.com/.
Your previous credentials should work. If not, contact the central support at central-support@sonatype.com. See this page for more details.
Q: this requires a lot of changes to my build logic. Do I have to use the new Portal API?
Because it’s not always convenient to change your build logic, the Sonatype team introduced a compatibility OSSRH url so you can use your current tooling to publish to the Central portal. Typically, this is done by replacing your repository url:
repositories { maven { name = 'ossrh-staging-api' url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" url = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/" }}Or if you were using S01:
repositories { maven { name = 'ossrh-staging-api' url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" url = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/" }}The Portal API is the recommended way moving forward though and it is recommended to migrate.
Q: Can I still use oss.sonatype.org/s01.oss.sonatype.org?
No, the date for OSSRH sunsetting was June, 30th 2025. The service is now EOL.
Q: What is the difference between the Portal API and the previous OSSRH API?
The Portal API is a single HTTP POST request that uploads a .zip file containing all your artifacts, signatures, .pom, .module files, etc…
The previous OSSRH had multiple endpoints to create/release/delete staging repositories. Files were uploaded one by one using multiple HTTP PUT requests. You also had the option to upload files directly without creating a staging repository and an implicit staging repository would be created automatically based on your IP address.
Q: Is the Central Portal better than the older OSSRH?
What better means is very objective, obviously.
Speaking only for myself, I like that:
- The UI feels more modern.
- The Portal API is clearly documented.
- The
zipapproach makes deployments makes everything more atomic. No more weird half-closed staging repos! - More generally, uploading everything all at once simplifies everything and removes the heuristics where staging repositories [were created based on your IP], causing split repos and other issues.
I dislike that the stats are hosted on a different service, which doesn’t seem to provide the same access to the raw data as the previous OSSRH. That part is still relatively new so still under investigation.
Uploading everything all at once also is generally slower since you can’t really upload files as they are built by Gradle. I guess you theoretically could, but that’s not something Nmcp is currently equipped to do. You may create several zips if you upload different projects in parallel, but you won’t be able to beat the raw speed of the previous scheme. Since publishing is always done in CI and doesn’t use my machine time, this is a trade-off I am comfortable with.
That migration also broke browsing the SNAPSHOTs, so it’s not all moonlight and roses. But A facelift on OSSRH was certainly needed, and I hope the system will improve gradually from that point.
Q: Where do I find the stats in the Central Portal?
See the question above. You can opt in scarf.sh to get your packages download data.
Q: What is Sonatype?
Sonatype is the company that operates Maven Central.
Q: Can I host commercial software on Maven Central?
Yes, it is discouraged, and the Portal checks requires that you upload a sources jar. But that sources jar may be empty if your project is closed source.
Q: Something went wrong, can I contact Sonatype support?
Yes, you can contact Sonatype support at central-support@sonatype.com.
Q: How long does it take to publish something on Maven Central?
It depends. I have seen from a couple of minutes to a few hours. The validation step (verifying signatures, source jars, etc…) is usually faster, in the order of minutes per project. The publishing part may take longer.
If your deployment reaches the PUBLISHING state it should become available on Maven Central at some point. I have never seen that step fail so far.
Q: What API is used to upload SNAPSHOTs?
Uploading to the SNAPSHOTs (https://central.sonatype.com/repository/maven-snapshots/) still uses the old OSSRH file-by-file API.
Nmcp has its own implementation of a Maven Publisher that uploads the artifact files and updates the maven-metadata.xml files for keeping track of the versions.
Q: Why can’t I browse SNAPSHOTs?
Browsing the SNAPSHOTs is currently not working.
Q: My deployment failed to upload with status XXX? What is going on?
The status codes are not documented, but a community maintained list is available in the source code. If you bump into an unknown status code, please send a PR!