Packaging a Release

This document is intended for committers who are packaging a release. It likely won't be of much use to anyone else.

Initial One-Time Setup

If this is the first time you're performing a release, configure your SourceForge and Sonatype credentials in ~/.m2/settings.xml (see Security and Deployment Settings).

<settings>
  ...
  <servers>
    <server>
      <id>htmlunit-website</id>
      <username>mguillem,htmlunit</username>
      <!-- optional element:
        <password>your-sourceforge-pwd</password>
      -->
    </server>
    <server>
      <id>sonatype-nexus-snapshots</id>
      <username>your-jira-id</username>
      <!-- optional element:
        <password>your-jira-pwd</password>
      -->
    </server>
    <server>
      <id>ossrh</id>
      <username>your-jira-id</username>
      <!-- optional element:
        <password>your-jira-pwd</password>
      -->
    </server>
  </servers>
  ...
</settings>

Deploying Snapshots

To deploy a snapshot build:

mvn clean deploy -Dmaven.test.skip=true

Release Procedure

Follow these steps for each release:

  1. Update Maven to the latest version and clean the local repository cache if needed.
  2. Because of the circular dependency with HtmlUnitDriver, create a local release of the driver first:
    1. Update the version number in pom.xml.
    2. Build and install to local repository:
      mvn -up -U clean install -Dmaven.test.skip=true
  3. Update the version number in pom.xml.
  4. Update the version number and release date in src/site/xdoc/index.xml (including the Maven dependency snippet).
  5. Update the release date in src/changes/changes.xml.
  6. Update the version number, release date, and Maven dependency in README.md.
  7. Remove references to any snapshot repository from pom.xml (required for Maven upload requests).
  8. Build the site and release zip files:
    mvn -up -U clean site package -Dmaven.test.skip=true
  9. Upload the two generated zip files (htmlunit-x.y.z-bin.zip and htmlunit-x.y.z-src.zip) to SourceForge, and set the binary package as the default download for all platforms.
  10. Ensure all workspace changes are committed to Git.
  11. Ensure HtmlUnit-related dependency tags exist in the repository.
  12. Deploy the release to the Sonatype OSS Maven repository:
    mvn deploy -Dmaven.test.skip=true
    Then visit the Sonatype OSS staging repository to close and release the artifacts.
  13. Draft the GitHub release:
    1. Open https://github.com/HtmlUnit/htmlunit.
    2. Click Releases > Draft a new release.
    3. Fill in the tag and title fields with the target version number (e.g. 3.11.0).
    4. Attach htmlunit-x.y.z-bin.zip and htmlunit-x.y.z-src.zip.
    5. Do not publish yet—additional artifacts will be attached in a later step.
  14. Open a shell session on SourceForge:
    ssh -t mguillem,htmlunit@shell.sf.net create
  15. Clear the previous site deployment directory:
    rm -rf /home/project-web/htmlunit/htdocs/*
  16. Deploy the updated site documentation:
    mvn -Dmaven.test.skip=true site:deploy
  17. Build the OSGi bundle:
    mvn -Dmaven.test.skip=true org.apache.felix:maven-bundle-plugin:bundle
  18. Rename htmlunit-x.y.z.jar to htmlunit-x.y.z-OSGi.jar, then upload it to SourceForge files and the pending GitHub release.
  19. Publish the GitHub release.
  20. Announce the release on the mailing list and project social channels.
  21. Update the version number in pom.xml to start the next snapshot development cycle.