References
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+MavenHeads Up Mac Users!
If you get a complaint from Maven about Java Home not being properly set on your Mac do this at the CLI: echo $JAVA_HOME
export JAVA_HOME=$(/usr/libexec/java_home)
Instructions
Follow the instructions in the first reference up to, but not including step 7a.3 Stage a Release. At this point you've already gotten a Sonatype account, pushed snapshots to Sonatype's snapshots repo, and got your PGP keys setup on your machine. Now to upload your non-snapshot releases to Maven Central, you need to run some Maven commands from the CLI. Make sure you have Git installed on your machine as well. The following Maven commands work for multi-module Maven projects as well as single-jar projects. You'll need to adapt these commands to your specific project. These instructions are just a supplement to step 7a.3 on Sonatype's guide. Here are the CLI commands I ran to release XChange version 1.3.0...Tip!
Leave the -SNAPSHOT in your pom.xml. The release plugin removes it and increments to the next snapshot version for you automatically. It also tags the commit for you too.First Do a Dry Run
note: replace "xchange" with your own artifactId, replace 1.3.0 with your current version.
mvn clean
mvn release:clean
mvn --batch-mode -Dtag=xchange-1.3.0 -DreleaseVersion=1.3.0 -DdevelopmentVersion=1.3.1-SNAPSHOT -DdryRun=true release:prepare
mvn release:rollback
Then Do the Real Thing
note: replace "xchange" with your own artifactId, replace 1.3.0 with your current version.
mvn release:clean
mvn --batch-mode -Dtag=xchange-1.3.0 -DreleaseVersion=1.3.0 -DdevelopmentVersion=1.3.1-SNAPSHOT release:prepare
mvn release:perform -Darguments=-Dgpg.passphrase=PASSPHRASE
No comments:
Post a Comment