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

If this is the first time you're doing a release you'll need to perform some setup.

  1. Configure your SourceForge username in ~/.m2/settings.xml (see Security and Deployment Settings). As an example, my settings.xml looks like:
    <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>sonatype-nexus-staging</id>
          <username>your-jira-id</username>
          <!-- optional element:
            <password>your-jira-pwd</password>
          -->
        </server>
      </servers>
      ...
    </settings>

For SnapShots:

  1. Add parent to the pom.xml:
    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>
  2. Execute "mvn -Dmaven.test.skip=true deploy"
  3. Remove the parent project.

Now do this for each release:

  1. Update maven to latest version, and delete ~/.m2/repository folder.
  2. Update the version number in pom.xml
  3. Update the version number and release date in src/site/xdoc/index.xml
  4. Update the release date in src/changes/changes.xml
  5. Remove pom.xml reference to any snapshot repository (needed for Maven upload request).
  6. Remove <repositories> and <pluginRepositories> elements from pom.xml.
  7. Build the zip files
    mvn -up clean site package
  8. Upload the two zip files (htmlunit-x.y-bin.zip and htmlunit-x.y-src.zip) to SourceForge, and make sure the binary file is the default download for all platforms.
  9. Build the OSGi bundle
    mvn -Dmaven.test.skip=true org.apache.felix:maven-bundle-plugin:bundle
  10. Rename 'htmlunit-x.y.jar' to 'htmlunit-x.y-OSGi.jar', and upload it to SourceForge files.
  11. Add a new Milestone in SourceForge bugs system.
  12. Make sure everything is checked in and tag the release:
    mvn scm:tag
    
  13. Ensure HtmlUnit-related dependencies are 'tagged' in the repository.
  14. Deploy the release to Sonatype OSS Maven repository (which is the way we have to go to deploy to the main repository). This process should be improved. Here is what has been done to deploy release 2.11: mvn -up -Dmaven.test.skip=true clean site package
    mvn javadoc:jar
    mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=pom.xml -Dfile=target/htmlunit-2.11.jar
    mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=pom.xml -Dfile=target/htmlunit-2.11-sources.jar -Dclassifier=sources
    mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=pom.xml -Dfile=target/htmlunit-2.11-javadoc.jar -Dclassifier=javadoc
    
    and then go to Sonatype OSS staging repository to close and release the artifacts.
  15. Delete online website (/home/project-web/htmlunit/htdocs).
  16. Create a shell to shell.sourceforge.net with your username and project group (see Maven site plugin for details).
    ssh -t mguillem,htmlunit@shell.sf.net create
  17. Deploy the site documentation (skipping the tests again).
    mvn -Dmaven.test.skip=true site:deploy
  18. Add pom.xml reference to previously removed snapshot repository.