Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Content

Table of Contents
minLevel2
outlinetrue
stylenone

Building Steps (Struts)

Getting ready

  1. Create an "Struts 2.x.y omnibus ticket" ticket in JIRA to refer to in upcoming release related commit comments and for general documentation purposes. Mark it with priority "Blocker".
  2. Switch to branch develop
  3. Ensure that the master POM and Struts Annotations have current releases
  4. Review JIRA for any issues without a fix version set, and for any issues that should be resolved for the pending release.
  5. Ensure that there are no repositories or pluginRepositories listed in the poms.
  6. If you have committed all changes regarding the release process, close the omnibus ticket as it is the last open ticket for the upcoming release
  7. Release the upcoming version in JIRA (under Administration/Manage Releases) and tag the release date
  8. Add next milestone version to the JIRA roadmap
  9. Create DONE and TODO filters for the new version, share with all, and remove obsolete TODO filter
  10. Create a new Version Notes page in Confluence, link from Migration Guide, and link to prior release page and JIRA DONE filters of the version to release
Note

Before starting release process make sure that the Docs were exported to https://cwiki.apache.org/WW/! Check the Version Notes page!

Obtain a fresh checkout.

Code Block

svn co https://svn.apache.org/repos/asf/struts/struts2/trunk STRUTS_#_#_#

Change site target

Edit the top pom.xml file and replace 2.x the url below with major.minor.x part of version number that's going to be released (eg. version is 2.3.10 -> 2.3.x) and rename development folder to release.

Before:

...


    <distributionManagement>
        <site>
            <id>apache-site</id>
            <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/struts/content/development/2.x/</url>
        </site>
    </distributionManagement>
After:

...


    <distributionManagement>
        <site>
            <id>apache-site</id>
            <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/struts/content/release/2.3.x/</url>
        </site>
    </distributionManagement>
  1. Export wiki pages and put them under /docs
  2. Create a new branch using git flow (or just git) - git flow release start X.X.X.X - where X.X.X.X is the version you want to release

Be sure your local copy is up-to-date.

Code Block
git checkout develop
git pull

git fetch origin --prune

commit the change

Update version of archetypes

...

Tag the release by using the "release:prepare" goal of Maven:

Code Block

mvn release:prepare -DautoVersionSubmodules=true -Dusername=yourSvnUsername -Dpassword=yourSvnPassword

...

When prompted for the SCM tag name, follow this pattern: STRUTS_2_3_[PATCH_VERSION]

Note

For some reason, when using svn client 1.5, the release plugin might fail to tag the release, if it fails, run:
svn up -r head
mvn release:prepare -Dresume

...

]

...

Note

If you get the an error message above, try to re-run mvn release:prepare -Dusername=yourSvnUsername -Dpassword=yourSvnPassword -DautoVersionSubmodules=true command again, -Dresume flag is set to true by default and the plugin will resume the release process from where it failed before.

This step will (more information):

  • Check that there are no uncommitted changes in the sources
  • Check that there are no SNAPSHOT dependencies
  • Change the version in the poms from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
  • Transform the SCM information in the POM to include the final destination of the tag
  • Run the project tests against the modified POMs to confirm everything is in working order
  • Commit the modified POMs
  • Tag the code in the SCM with a version name (this will be prompted for)
  • Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
  • Commit the modified POMs

Follow the link to get more information about performed operation by release plugin.

Perform the release

Code Block

mvn release:perform -Dusername=yourSvnUsername

This step will (more information):

  • Checkout from an SCM URL with optional tag
  • Run the predefined Maven goals to release the project (by default, deploy site-deploy)

Follow the link to get more information about performed operation by release plugin. After this step the artifacts will be hosted by Nexus.

If you need to run perform again, (or in a different box), do:

Code Block

svngit co https://svn.apache.org/repos/asf/struts/struts2/tags/$VERSION
cd $VERSION
checkout STRUTS_2_3_[PATCH_VERSION]
mvn javadoc:javadoc deploy --no-plugin-updates -DperformRelease=true -Papache-release

...

After closing repository in Nexus, check if the release files are available from staging repository as bellow:

Code Block

https://repository.apache.org/content/groups/staging/org/apache/struts/struts2-assembly/$VERSION/

In order to move the assemblies login to people.apache.org and execute the following code:

Code Block
none
none

#!/bin/sh
# create the destination directory
mkdir $VERSION
cd $VERSION

# get the distro
wget -erobots=off -nv  -l 1 --accept=zip,md5,sha1,asc -r --no-check-certificate -nd -nH https://repository.apache.org/content/groups/staging/org/apache/struts/struts2-assembly/$VERSION

# rename files
for f in *2-assembly*.zip*
do
 mv $f `echo $f | sed s/2-assembly//g`
done

# remove unneeded files
for f in struts2-assembly-*.pom*
do
 rm $f
done

# remove unneeded hashes
rm *.asc.md5
rm *.asc.sha1

After that move the assemblies directory to the builds destination with

Code Block

mv $VERSION /www/people.apache.org/builds/struts/

Jira stuff

...

...

Announce availability

Send a short e-mail to dev@struts.a.o informing about the new packages and to give people enough time to test the distribution (actual bits). Wait around a week before posting Vote. If no show-stoppers reported, start a vote thread for build quality designation.

...

Post a release/quality vote to the dev list (and only the dev list). The example mail is on Sample Announcementsannouncements page.
If the vote result is for an ASF release (i.e. not test build), update site, announce. If the vote result is for GA, push to central.

...

After the vote, if the distribution is being mirrored (there was a favourable release vote) copy the Sources and Binaries:

Code Block

ssh people.apache.org
cd /www/people.apache.org/builds/struts/$VERSION
cp struts-$VERSION-src.*  /www/www.apache.org/dist/struts/source
cp struts-$VERSION-docs.*  /www/www.apache.org/dist/struts/documentation
cp struts-$VERSION-lib.* /www/www.apache.org/dist/struts/library
cp struts-$VERSION-apps.* /www/www.apache.org/dist/struts/examples
cp struts-$VERSION-all.* /www/www.apache.org/dist/struts/binaries   

...

Remove the old files from under /www/www.apache.org/dist/struts/ to synchronise only the latest version with peers. All the files from /www/www.apache.org/dist/ are always mirrored to http://archive.apache.org/dist/struts/. You can use the below command:

No Format

cd /www/www.apache.org/dist/struts/
find . -type f -name "struts-2.3.x*" -exec rm -f {} \;

...

If the release will fix a - hopefully yet undisclosed - security issue, it's now time to update the Security Bulletins page and add a new announcement. For a template, just check former announcements

...

...

The below is not true any more - please wait for update!

Update site

...

Code Block

ssh people.apache.org
export VERSION=2.#.#

unzip /www/people.apache.org/builds/struts/$VERSION/struts-$VERSION-docs.zip -d ~/docs
#now the docs are under ~/docs/struts-$VERSION/docs
mkdir -p /www/struts.apache.org/$VERSION
mv ~/docs/struts-$VERSION/docs/* /www/struts.apache.org/$VERSION
chmod -R g+w /www/struts.apache.org/$VERSION

Edit /www/struts.apache.org/$VERSION/archetype-catalog.xml and update the version of artifacts

Update site (Struts top level site)

  • Check out site src code

    Code Block
    
    svn co https://svn.apache.org/repos/asf/struts/site/ struts-site
    
  • Update xml files
    • struts-site/src/site/xdoc/announce.xml (if applicable, refer also to corresponding security bulletin)
    • struts-site/src/site/xdoc/downloads.xml (remove previous version)
    • struts-site/src/site/xdoc/download.xml (remove previous version)
    • struts-site/src/site/xdoc/index.xml
    • struts-site/src/site/site.xml
    • struts-site/src/site/resources/archetype-catalog.xml
  • Commit the changes
  • Generate the site

    Code Block
    
    mvn site:site
    
  • Open struts-site/target/site/index.html and verify the urls and versions are right
  • Deploy site

    Code Block
    
    mvn site-deploy
    

    It takes a few hours for the site changes to go live

Rollback site target

...

Redeploy the draft docs (Optional)

Make public available all the pages that could leak confidential information about the vulnerability. Wait or manually export the space in Confluence. Build snapshot locally and copy assembly/target/assembly/out/struts2-#.#.#-SNAPSHOT-docs.zip to people.apache.org and update /www/struts.apache.org/2.x/docs

Permissions

After updating the site, be sure that the permissions are set to group writeable ($ chmod -R g+w .)

Post announcements

We leave this as the last step, once the artifacts have had time to sync up on the mirrors. Target it to: user@struts.a.o and announcements@struts.a.o, samples are available at Sample announcements page