-
Notifications
You must be signed in to change notification settings - Fork 4
Releasing an artifact to Maven Central Repo
Releasing an artifact to the Maven Central Repository there is a process that involves a couple of steps. Depending whether you want to create your own repository or use an existing one from 1&1, you can search on the Internet for the entire process or you can use some things that were already implemented inside the company. All the projects can be also found in github at https://github.com/1and1
You need to have a Sonatype Account in order to be able to add tickets to Sonatype’s JIRA. https://issues.sonatype.org/secure/Signup!default.jspa
An example of a ticket can be found at https://issues.sonatype.org/browse/OSSRH-18964
Every artifact needs to be signed. For this you can use GnuPG, for generate a key
You can use several public keyservers to public you key. An example would be: hkp://keyserver.ubuntu.com or pgp.mit.edu To learn more about publishing a key please go to: https://help.ubuntu.com/community/GnuPrivacyGuardHowto
The foss-parent pom is verifying the headers from each java class inside the project. You can find the header at: https://github.com/1and1/foss-configs/tree/master/src/main/resources/net/oneandone/maven/poms/fossconfigs In license-header.txt
https://github.com/1and1/foss-parent
<settings>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>sonatype-user</username>
<password>sonatype-pwd</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>sonatype-user</username>
<password>sonatype-pwd</password>
</server>
</servers>
</settings>
In order to prepare your release, synchronize it with the github project you will need to run mvn release:prepare Add -Dresume=false to start a fresh release and not resume an old one.
After preparing your release, you need to effectively upload it. This is done using this command. If the process success, your artifacts will be uploaded to Nexus Staging repository
Go to Sonatype Nexus repository (https://oss.sonatype.org/#welcome), find your artifact, close it, test it, and after that release it to the Central Repository. Close and release staging repository: https://oss.sonatype.org/index.html#stagingRepositories
- http://www.sonatype.org/nexus/2015/06/02/how-to-publish-software-artifacts-to-maven-central/ - Steps for publishing an artifact to Maven Repository
- http://central.sonatype.org/pages/releasing-the-deployment.html - Releasing a deployment
- https://oss.sonatype.org/#welcome – Sonatype Nexus repository for finding your artifacts before releasing them from staging repositories
- https://maven.apache.org/plugins/maven-gpg-plugin/usage.html - usage of the maven gpg plugin for signing the artifacts
- https://help.ubuntu.com/community/GnuPrivacyGuardHowto - GnuPG usage