This is a brief procedure to publish artifacts to the maven Central.
Initial Setup at Sonatype Jira
The important and mandatory during jira ticket creation are:
- Group Id
- Project URL
- SCM url
Working with PGP Signatures
Installing GnuPG
If gpg
is not installed, get it from here http://www.gnupg.org/download/
Generating a Key Pair
Generate the keys, provide the information as prompted.
Listing Keys
The key-id is the 9D9D7541
.
Distributing Your Public Key
Send the public key to public key server
To import your public key from the key server to their local machines:
Bonus: Add Key in github.
If you have github account, you can add this gpg key for syncing with the github.
Requirement at the Project Object Model file
The folloing are the mandatory Requirement to define in the POM file.
Correct Coordinates
Should be valid and unique GAV(Group-Artifact-Version) definition.
Project Name, Description and URL
Define the type of License.
Distribution Management.
Authentication at ossrh
Define the authentication for the ossrh at the maven settting.xml as
And define the GPG credential as well:
Supply Javadoc and Sources
Sign Files with GPG/PGP
For more example on the POM structure.
Deployment
To deploy the artifact at the maven central.
Snapshots
If all is fine should be available under : https://oss.sonatype.org/content/repositories/snapshots/
Release
Set the proper version without snapshots and activate the release profile.
If all is fine should be available under : https://oss.sonatype.org/content/repositories/releases/
For more information on the apache maven.