Hosted By:

CruiseControl Build Results JSP

What Is It?

Screenshot of the build results reporting application

The Build Results JSP is designed to present the results of the cruisecontrol build loop. The left side of the page tells us about whether CruiseControl is currently building your project, and provides links to the details of previous builds. The right side of the page presents the results of the build -- including compilation errors, test results, and details about what files have changed since the last build.

How Does It Work?

The JSP uses custom tags to handle most of its processing. This gives us a clean separation between code and content, leaving developers to modify code without worrying about page design, and designers can concentrate on modifying the layout without having to understand any Java code. All of the fonts and colors are controlled using CSS, so that these details can be configured in an easy and centralized manner. The build details on the right-hand side of the page are created using XSL to transform our XML build logs created by the CruiseControl build loop into HTML that can be added into our JSP. The links on the left-hand side of the page are created by listing the files in the CruiseControl log directory. Each build log follows a naming convention so that the JSP can easily parse the directory listing into links to a particular build. The details about whether the build is running come from a text file which is written by the CruiseControl build loop at the beginning of the build and at the end of the build. This file contains a snippet of HTML which is then included in the build results JSP.

Note that the latest version of the JSP may not be compatible with build logs created using the CruiseControl 1.x build loop. See the Known Issues section below for more details.

New Features

Split XSL For Easier Configurability

Previous versions of the Servlet/JSP used one cruisecontrol.xsl stylesheet to transform the build log to HTML. By splitting it into pieces, it's easier to insert your own custom XSL into the JSP. It's also easier to edit a smaller piece of XSL than to deal with the unwieldy large XSL stylesheet that we had.

Less Configuration Necessary

The 1.x version of the JSP/Servlet required a lot of configuration in the web.xml. We've boiled this down to 2 parameters that need to be configured, thus helping to get you up and running quicker. The missing parameters are still configurable, but you won't have to worry about them if you're going to use the default values.

XSL Transform Caching

Running the XSL transform takes some resources on the server. There's no reason to do this operation every time. The latest buildresults.jsp will run the transform upon the first page request, and keep the results cached until any of the files involved (the log file or the xsl stylesheet) are out of date with the cached file.

JSP Custom Tags and CSS

We've pulled most of the Java code into custom JSP tags. As a result, the HTML produced by the buildresults.jsp is much easier to customize to your needs. All of the font/color information has been pulled into a CSS stylesheet so there is no need to wade in the XSL to change the color of an error message, for example. It also helps keep the look of the page more consistent.

Sample Logs

The latest version of the source code for the JSP includes a directory of sample log files. These are useful for confirming that your JSP is running correctly, should you be experiencing any problems.

Known Issues

Incompatibility with CruiseControl 1.x Log Files

The log file format has changed, and as a result, log files created with the CruiseControl 1.x build loop may not render correctly. A semi trivial upgrader could be developed if demand warrants.