You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Apache Struts Pseudo-Nightly Builds on Apache Hudson

Apache Struts has moved their Continuous Integration builds over to the Apache owned instance of Hudson. Hudson is a popular open source CI server with a plugin interface that allows for flexible building and management. More information and documentation about Hudson is available here - https://hudson.dev.java.net/. Out of the box, Hudson supports SVN and Apache Maven, which makes it a good fit for Apache Struts. The Apache instance of Hudson is used by a few other projects, but has more than enough cycles available for our needs. One advantage of using Hudson hosted by Apache is that other committers will be able to gain access to both the Hudson web-app performing the builds and the host that houses the Hudson web-app. To request access to the Hudson zone and Hudson web-app, any PMC member can follow the instructions outlined here - http://wiki.apache.org/general/Hudson.

User Information

Hudson is currently setup to perform our SNAPSHOT builds. SNAPSHOT builds are not considered stable, but many developers use these builds because they will often contain the latest features and fixes. The price for using the latest and greatest is that you run the risk of stumbling across previously undiscovered bugs. If you are using a SNAPSHOT build and encounter a problem with the framework, then you should first ask about the problem on the user@struts.apache.org mailing list. Most of the Struts developers actively provide support on the user mailing list and will most likely indicate whether there is a workaround or if a bug report should be filed. To join the mailing list, follow the instructions here, bugs are filed here.

To see the results of the latest and previous Hudson builds, you can visit the Struts view on Hudson here. As part of the build process, Hudson is configured to deploy the artifacts to the snapshot repository. Rather than downloading the artifacts directly from Hudson, it is easier to configure your project to grab the snapshots from the snapshot repository. This is quite easy if you are using Maven, check here for information on adding the Struts Snapshot Repository. If you do not use Maven, Hudson also pushes downloadable copies of our libraries, documentation and reference applications. You can download those here.

Build Setup - High Level

Hudson's build facility is somewhat simple. You tell it where to grab the source and then it will build. Each build will checkout what you tell it to and begin building from the directory you specify. This only presents a few minor problems. My first thought was to check out the entire source tree and then dive into each individual directory (maven, struts1, struts2, sandbox) and launch a build. This did not work since Hudson wants to do one build at a time. Also, it does not allow you (as far as I could tell) to specify the same workspace for subsequent builds. Fortunately, this was relatively easy to work around. The Struts 1. x and Struts 2.x builds depend on the struts-master and struts-annotations artifacts. Although these artifacts are published to the public Maven repositories, they contain information that the other builds need. For instance, the top-level pom.xml in the struts2 source directory declares struts-master as it's parent. To make this work, I setup struts-master and struts-annotations as their own builds in Hudson. The build setup for these two simply points to their source directory in SVN and runs the clean and install maven goals. This way, both artifacts are installed into the local maven repository for Hudson. After that, I setup builds for both the struts1 and struts2 directories in SVN.

Build Setup - Struts 1.x

<action name="SomeAction" class="com.examples.SomeAction">
   <interceptor-ref name="@INTERCEPTOR-REF-NAME@"/>
   <result name="success" type="freemarker">good_result.ftl</result>
</action>
  • No labels