I suppose that one needs some pass to submit an artifact to Maven Central repository.
I'd like to know, in detail, what are the requirements, what is the procedure to follow, and if there is a tutorial or guide to help in this process.
I heard you need also to digitally sign (gpg) the artifacts, some details regarding this would also be welcome.
If your code is OSS, there's a "fast track" process for publishing via Sonatype.
See the Sonatype OSS Maven Repository Usage Guide
Basically, here's what I've done for beanstalk-maven-plugin a while ago:
I've generated and registered a new GPG key for my email in the HKP Keyservers (a no brainer). Make sure you have backups of your keys (actually, I suggest you create your key in an entirely separate machine, so you could know your backup / export procedures are working)
Opened an Issue in Sonatype OSS Project Jira Tracker pointing the groupId, source SCM url, and other details. It takes around 48h for approval.
Configured my pom.xml
to use sonatype-parent pom as a parent. This adds a lot of extra information and validation.
Set up SCM for Tagging / Releasing.
Set up jenkins so my -SNAPSHOT
releases would also be published into oss.sonatype.org.
Now, the release procedure itself via Sonatype is pretty straightforward:
release:prepare
and release:perform
into the OSS Staging. Your new release will go into Sonatype StagingIf you're using Maven, most of the changes just require decorating your POM with the relevant detail (group, mailing lists, home page, and especially the <scm/>
). The sonatype-oss-parent
(see its source) pom does all the remaining work, which includes:
<distributionManagement/>
tagsmaven-enforcer-plugin
configuration (in particular, to avoid some bad signatures from the maven-gpg-plugin
)maven-release-plugin
for a special build profile to be called when released on OSS, which includes invocations for:
source:jar
javadoc:jar
gpg:sign
Of course, you can do it all by hand - Just copy the contents of sonatype-oss-parent into your own. However, I think its a bit of avoidable cruft. :)
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With