Instructions for releasing Jaybird to Maven

Author: Mark Rotteveel

Prerequisites:
To release artifacts to Maven you need access to the repository. To get access, add a request to:
https://issues.sonatype.org/browse/OSSRH-3069

You will also need a PGP/GPG key to sign the artifacts

Additional information:
http://tracker.firebirdsql.org/browse/JDBC-241
http://maven.apache.org/guides/mini/guide-central-repository-upload.html
https://docs.sonatype.org/display/Repository/Central+Sync+Requirements
https://docs.sonatype.org/display/Repository/Choosing+your+Coordinates

Repository URLs:
Deploy snapshot artifacts into repository https://oss.sonatype.org/content/repositories/snapshots
Deploy release artifacts into the staging repository https://oss.sonatype.org/service/local/staging/deploy/maven2
Promote staged artifacts into repository 'Releases'
Download snapshot and release artifacts from group https://oss.sonatype.org/content/groups/public
Download snapshot, release and staged artifacts from staging group https://oss.sonatype.org/content/groups/staging

Instructions:

WARNING:
The release of Jaybird to Maven is largely a manual process as Jaybird itself is not build using Maven.

For actual releases (not snapshots), first tag the repository content and build from that tag.

Step 1: 
Build the distribution zips for each JDK version to be released

Unzip the distribution zips to separate folders (one for each JDK version)
(you only need to jaybird-<version>.jar, jaybird-<version>-sources.jar and jaybird-<version>-javadoc.jar)

Step 2:
Prepare the POM file.
* Copy the jaybird-example.pom to each JDK folder as jaybird-jdkXX.<version>.pom
* Modify the POM:
	- Change artifactId from jaybird-jdkXX to the right jdk version (eg jaybird-jdk17 for Java 7)
	- Change the version to reflect the release version, examples:
		For the 2.2.0 release: <version>2.2.0</version>
		For the 2.2.1 beta release: <version>2.2.1-beta-1</version>
		For a 2.2.1 SNAPSHOT: <version>2.2.1-SNAPSHOT</version
* Check if the dependencies are still valid

Step 3:
TODO: Research if deploying bundled artifacts isn't easier (see 7b on https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide)

Bundling is easier:

gpg -ab every individual file
jar -cvf bundle.jar *

Upload according to above link

Sign and deploy jar-files (replace paths, url and repositoryId as necessary; example deploys to snapshot repository)
JDK 17:
mvn gpg:sign-and-deploy-file -DpomFile=jaybird-jdk17-2.2.4-SNAPSHOT.pom -Dfile=jaybird-jdk17-2.2.4-SNAPSHOT.jar -Dsources=jaybird-jdk17-2.2.4-SNAPSHOT-sources.jar -Djavadoc=jaybird-jdk17-2.2.4-SNAPSHOT-javadoc.jar -Durl=https://oss.sonatype.org/content/repositories/snapshots -DrepositoryId=sonatype-nexus-snapshots

NOTE: When deploying a snapshot, signing is optional

Step 4: (release only)
Promote the artifact following steps in section 8 of https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide