Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Clear out your existing build artifacts
  • Compile and package up your code into a JAR
  • Generate JavaDoc from your project and package it as a JAR
  • Package up your source code as a JAR
  • Sign the JAR and POM files with your GPG key
  • Install the resulting artifacts into your local Maven cache
  • Deploy the resulting artifacts into the remote Nexus repository

Staging a New Release

See https://books.sonatype.com/nexus-book/reference/staging-repositories.html

...

You can see the list of checks by selecting the staging repository and viewing the "close" item of the "Activity" tab

Problems Closing?

  • If you artifact(s) fail the GPG signing stage, you may need to upload them to an accepted keyserver (it should list the keyservers that its checking, just pick any one and give it some time to propagate the change before trying again):

    Code Block
    languagebash
    $ gpg --keyserver <KEYSERVER_URL> --send-keys <YOUR_KEY_ID_WHICH_WILL_BE_FAIRLY_LONG>



  • If your artifacts fail the sources or javadoc checks, make sure you have generated them as part of your build (ensure they each have  an <executions> tag in your pom.xml). If they are third-party artifacts that are missing source or javadoc, see below.

...

<placeholder for what happens upon "Release">

Automation

Insert snippet about Maven Release Plugin or Nexus Staging Maven Plugin, which supposedly helps to automate the above processes

Code Block
languagebash
	    <build>
		  <plugins>
            <!-- More plugins... -->

			<!-- Maven Release Plugin -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.5.3</version>
				<configuration>
					<mavenExecutorId>forked-path</mavenExecutorId>
					<useReleaseProfile>false</useReleaseProfile>
					<arguments>-Psonatype-oss-release</arguments>
				</configuration>
			</plugin>


            <!-- More plugins... -->


          </plugins>
        </build>


Third-Party Dependencies

What do you do if one of your dependencies has not been uploaded to The Central Repository? All is not lost!

...