mvn clean test jacoco:report
- Read rules
- Register on Sonatype OSSRH
- Provide project details for Sonatype OSSRH
- Create tiket for project
*
Summary
: I want to publish artifact of my project to Maven Central *Description
: I own domainvalery1707.name
*Group ID
: name.valery1707 *Project URL
: https://github.com/valery1707/jcommander-ext *SCM URL
: https://github.com/valery1707/jcommander-ext.git *Already Synced to Central
:No
- Wait for ticket resolution
- Add credentials for Sonatype OSSRH into maven
- Detect maven HOME:
mvn --version | grep 'Maven home'
- Edit
conf/setting.xml
from maven home - Inside
servers
add newserver
*id
:ossrh
*username
: your-jira-id *password
: your-jira-pwd - Install GPG
- Check sign:
mvn clean package verify -P release -Dgpg.passphrase=real-gpg-passphrase
- Commit and deploy artifact to Sonatype OSSRH
mvn versions:set -DnewVersion=0.1.0
git commit -m 'Release version 0.1.0' pom.xml */pom.xml
mvn clean deploy -P release -Dgpg.passphrase=real-gpg-passphrase
mvn versions:set -DnewVersion=0.1.0-SNAPSHOT
git commit -m 'Prepare for next development iteration' pom.xml */pom.xml
- Promote artifacts to Maven Central
- Login into Sonatype OSSRH
- Find staging repository with name
namevalery1707-
Close
it- Wait some time, refresh page
Release
- After some time (about 10 minutes) artifact will be published into Maven Cenral
- After more time (about 2 hours) new release will be accessible on search
- Release on Github
git tag -u '[email protected]' -m 'Release version 0.1.0' v0.1.0 HEAD~1
git push
git push --tags