<?xml version="1.0"?>
<document>

    <properties>
        <title>Packaging a release</title>
        <author email="mbowler@GargoyleSoftware.com">Mike Bowler</author>
        <author email="asashour@users.sourceforge.net">Ahmed Ashour</author>
        <revision>$Revision: 5556 $</revision>
    </properties>

    <body>
        <section>
            <p>
                This document is intended for committers who are packaging a release.  It likely won't be
                of much use to anyone else.
            </p>
            <p>
            	If this is the first time you're doing a release you'll need to perform
            	some setup.
            	<ol>
           			<li>
           				Configure your SourceForge username in ~/.m2/settings.xml (see <a href="http://maven.apache.org/guides/mini/guide-deployment-security-settings.html">Security and Deployment Settings</a>). 
						As an example, my settings.xml looks like:
<source>
<![CDATA[<settings>
  ...
  <servers>
    <server>
      <id>htmlunit-website</id>
      <username>mguillem,htmlunit</username>
      <!-- optional element:
        <password>my_login_password</password>
      -->
    </server>
    <server>
      <id>htmlunit-m2-repo</id>
      <username>mguillem,htmlunit</username>
      <!-- optional element:
        <password>my_login_password</password>
      -->
    </server>
    <server>
      <id>htmlunit-m2-repo-snapshots</id>
      <username>mguillem,htmlunit</username>
      <!-- optional element:
        <password>my_login_password</password>
      -->
    </server>
  </servers>
  ...
</settings>]]></source>
           			</li>
           		</ol>
       		</p>
            <p>
                Now do this for each release:
                <ol>
                    <li>
                        Update the version number in pom.xml
                    </li>
                    <li>
                        Update the version number and release date in src/site/xdoc/index.xml
                    </li>
                    <li>
                        Update the version number and release date in src/changes/changes.xml
                    </li>
                    <li>
                        Remove pom.xml reference to any snapshot repository (needed for Maven upload request).
                    </li>
                    <li>
                        Build the zip files
                        <source>mvn -up clean site package</source>
                    </li>
                    <li>
                        Upload the two zip files to
                        <a href="https://sourceforge.net/project/admin/explorer.php?group_id=47038">SourceForge</a>,
                        and make sure the binary file is the default download for all platforms.
                    </li>
                    <li>
                        Add a new Group in SourceForge tracker system.
                    </li>
                    <li>
                        Make sure everything is checked
                        in and tag the repository (to https://htmlunit.svn.sourceforge.net/svnroot/htmlunit/tags/) 
                        with a name like this "HtmlUnit-2.0" that reflects the current build version.
                    </li>
                    <li>
                        Ensure HtmlUnit-related dependencies are 'tagged' in the repository.
                    </li>
                    <li>Deploy the release to HtmlUnit Maven repository (which is synchronized with the main repository),
                        skipping the tests to save time as they have already been run previously
                        <source>mvn -Dmaven.test.skip=true deploy</source>
                    </li>
                    <li>
                        Delete online website javadoc.
                    </li>
                    <li>
                    	Create a shell to shell.sourceforge.net with your username and project group
                    	(see <a href="http://maven.apache.org/plugins/maven-site-plugin/examples/site-deploy-to-sourceforge.net.html">Maven site plugin for details</a>).
                        <source>ssh -t mguillem,htmlunit@shell.sf.net create</source>
                    </li>
                    <li>
                        Deploy the site documentation (skipping the tests again).
                        <source>mvn -Dmaven.test.skip=true site:deploy</source>
                    </li>
                    <li>
                        Add pom.xml reference to previously removed snapshot repository.
                    </li>
                </ol>
            </p>
        </section>
    </body>
</document>

