HowTo Release

Releasing is hard, so I'm recording this here as a reference. This walk-thru is based on the Sonatype release guide since Sonatype is where the official repository is for AndHow . After a new release, Sonatype automatically copies them over to Maven Central.

Currently requires running on Java 1.8 to ensure that 1.8 compatible jars are created (Only true for the 0.4.x releases)

Local build

mvn clean install -P source-and-javadoc-jar,gpg-sign,release-verification

(Verify the '-P' argument matches the 'releaseProfiles' of the release plugin in the main pom. This ensures this test install run matches the actual release run)

This will verify if all configuration for GPG is working correctly. Check your local ~/.m2/repository/org/yarnandtail/andhow/[version] to see if there are .asc signing files for each artifact, as well as javadocs and sources. It should look like this:

andhow-0.4.1-SNAPSHOT-javadoc.jar
andhow-0.4.1-SNAPSHOT-javadoc.jar.asc
andhow-0.4.1-SNAPSHOT-sources.jar
andhow-0.4.1-SNAPSHOT-sources.jar.asc
andhow-0.4.1-SNAPSHOT.jar
andhow-0.4.1-SNAPSHOT.jar.asc
andhow-0.4.1-SNAPSHOT.pom
andhow-0.4.1-SNAPSHOT.pom.asc

Verify local build

  • Verify the samples project runs against the new snapshot locally using JDK 1.8 and JDK 16 (and more)

  • Verify the 'shaded' andhow.pom file does not have dependencies in it

  • Sanity check size of andhow.jar

The andhow-samples project can be tried with different compile flags as well when using JDK9+

<configuration>
    <release>8</release>
</configuration>
<!-- or -->
<configuration>
    <source>8</source>
    <target>8</target>
</configuration>

Snapshot deploy to Nexus

This extra verification just ensures the gpg signing and uploads all work before actually doing the release:

mvn clean deploy

Snapshot Checks

  • Delete the local .m2/repository/..../yarnandtail and verify andhow-samples can pull down and build against the snapshot. Also check source and javadoc download.

  • Verify the samples project runs against the new snapshot on Travis CI

Release

mvn release:clean release:prepare
mvn release:perform

Login to https://oss.sonatype.org/

Select the Staging Repositories on the left navigation. I only see the latest uploaded staged release when I do this. Check it out... maybe download and try it.

It sounds like its possible to do the release from command line via the nexus plugin:

mvn nexus-staging:release

Or In the UI, the staging repository needs to be 'closed' (no further additions), then 'Released'.

Verify the release has propagated

After release, the artifacts should show up in the central Maven repo - It may take some time. Urls to check:

Verify AndHow Samples builds

Update samples to the new release and the samples homepage branch and make sure the Travis build succeeds

Other things to do after a release

  • Update the GitHub Release to point to the new tag

  • Update Readme of per the new release

  • Other documentation updates per changed code?

  • Testing page has a reference to the JUnit Extension version.

Post-release readme update

This happens all the time, so I'm leaving my future self notes here...

If readme or .github pages need an update and those changes are needed on the current release (i.e. the active homepage) and the main branch:

  • Make a branch from main for the changes

  • Submit a PR and merge to main

  • check out the homepage branch, then:

  • git cherry-pick $(git merge-base main update-branch)..update-branch

  • Then push to homepage

Last updated