ReleasingToMavenCentral
Appearance
This page was last updated in 2015 and may be outdated. Please update it if you can.
Maven projects based on the discovery-parent-pom should not follow the instructions below, but instead look at the Building and Release sections of this README.
Walkthrough
- Shove ReleasingToMavenCentral/Paranoid.xml into ~/.m2/paranoid.xml
- cd your_project
- mvn release:prepare
- git push --tags gerrit
- mvn release:perform
- git review
- Force everything through gerrit +2/+2
- Do the sonatype stuff over at https://oss.sonatype.org/
- git checkout <tag version that mvn release:prepare made>
- rm -rf ~/.m2/repository_backup; mv ~/.m2/repository ~/.m2/repository_backup
- mvn clean install -s ~/.m2/paranoid.xml
- Make sure you have Archiva configured
- In ~/.m2/settings.xml
- In your project's pom.xml
- mvn deploy
What can go wrong
git push --tags
If you don't have permission to push tags you'll need to get it granted.
mvn release:perform
If Sonatype gives you HTTP 401s, check your settings file.
~/.m2/settings.xml:
<settings> <servers> <server> <id>sonatype-nexus-staging</id> <username>MY_USERNAME</username> <password>MY_PASSWORD</password> </server> </servers> </settings>
git review
If you never installed the Change-Id
-generating commit hook, you'll need to install it, then go back and generate some Change-Id
s.
gitdir=$(git rev-parse --git-dir); scp -p -P 29418 MY_USERNAME@gerrit.wikimedia.org:hooks/commit-msg ${gitdir}/hooks/
git rebase -i HEAD~2
Change pick
to edit
, and continue as usual.
mvn clean install -s ~/.m2/paranoid.xml
If one of your dependencies is missing, you'll have to upload those to Archiva's mirrored repository. Make sure that the checksums you have agree with those on http://search.maven.org/