Integrating CruiseControl With WebLogic Workshop Applications
Pages: 1, 2, 3

Generating Useful Reports

After CruiseControl has completed the original task it called ( BuildMikesProject in our example), it will merge all the output sent to stdout with any logs found in theĀ  <log><merge.../></log> element in the CruiseControl config.xml file. It will generate one very long XML file that includes the build.log.xml file created by the WlwBuildToXml Ant task.

When a CruiseControl publisher generates an HTML report (including the HTMLEmail publisher), it runs all the XSL scripts in the $CC_HOME/reporting/jsp/xsl directory, assuming $CC_HOME is your CruiseControl home directory. The output of these XSL files run against the XML log becomes the body of the HTML document. To add the errors caught by the WlwBuildToXml Ant task to the document, we need to create another XSL file and save it in the $CC_HOME/reporting/jsp/xsl directory. The file wlw-errors.xsl is as follows:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="" version="1.0"


   <xsl:output method="html"/>

   <xsl:variable name="errors.list"


   <xsl:template match="/">

   <!-- if there were errors -->

   <xsl:if test="cruisecontrol/build/@error">

      <table align="center" cellpadding="2" cellspacing="0" border="1" width="98%">


            <td class="errors-sectionheader" colspan ="2">

            <b>Errors occurred during build: 

                (<xsl:value-of select="count($errors.list)"/>)</b>




            <th class="errors-sectionheader">Target</th>

            <th class="errors-sectionheader">Message</th>


         <xsl:apply-templates select="$errors.list"/>





   <!--deal with the data -->

   <xsl:template match="cruisecontrol/build//target/task/message">


         <xsl:if test="position() mod 2=0">

            <xsl:attribute name="class">errors-oddrow</xsl:attribute>


         <xsl:if test="position() mod 2!=0">

            <xsl:attribute name="class">errors-evenrow</xsl:attribute>


         <td valign="top" class="errors-data">

            <xsl:value-of select="ancestor::target/@name"/>


         <td class="errors-data">

            <xsl:value-of select="text()"/>





That's it! Start CruiseControl and make a change to your source control repository. If all the correct pieces are in place, CruiseControl will send you an email with a nicely formatted build report. The following figure shows a sample report.

Result of executing the style sheet
Result of executing the style sheet


This article shows how to extend a standard CruiseControl deployment by integrating the results of a WebLogic Workshop build. Setting up and extending CruiseControl may seem complicated, but there is excellent documentation and a very active mailing list. Once everything is set up you'll very quickly see positive results in your development team.


Michael Hart is a systems engineer at a high tech firm in Ontario, Canada, where he assists helps design and support a large WebLogic implementation.