📦 Publishing jar artifact via the Central Portal
Publishing to Maven Central is now available via Central Portal (actually, it has been here for a long time). No more registering using Jira ticket, now it looks more mature with sane Web UI, new API, webhooks, ability to confirm your namespace and more. Web UI and API allow you to upload your bundles manually if your build system doesn’t support it yet. Not so many tools support this at the moment, but the number is growing. For example, Gradle, Maven, sbt, mill are already among these.
If your build tool doesn’t support it and you don’t have time to develop a plugin yourself, as mentioned above, you can upload your bundle manually.
This is quite easy if your build tool is already capable of producing Maven artifacts. Assuming that you have the following output after publishing to your local Maven repository (for example, mill __.publishM2Local
or sbt publishM2
are producing such output):
me
`-- seroperson
`-- urlopt4s_2.13
`-- 0.2.0
|-- urlopt4s_2.13-0.2.0-javadoc.jar
|-- urlopt4s_2.13-0.2.0-sources.jar
|-- urlopt4s_2.13-0.2.0.jar
|-- urlopt4s_2.13-0.2.0.pom
4 directories, 4 files
All you have to do to get the resulting bundle is generate md5
, sha1
, asc
files. Actually, sometimes your output can contain necessary hashes - it depends on the build system. But if not, you can generate these hashes and sign files like this (requires pre-configured gpg
):
find . \( -name "*.jar" -or -name "*.pom" \) -exec sh -c "md5sum {} | cut -d ' ' -f 1 > {}.md5; sha1sum {} | cut -d ' ' -f 1 > {}.sha1; gpg --armor --detach-sign {}" \;
And now compress everything into .zip
archive (for example, using ouch):
ouch compress me/ urlopt4s_2.13.zip
Voilà! Bundle is ready, now you can manually upload it to the Central Portal.
Also take a look on the other notes: