Clone wiki

Java EE 6-Galleria / BuildServerIntegration

CruiseControl is used here, for reference, but Jenkins/Hudson or any another CI server could be used instead.

The project is configured in CC as:

  <project name="JavaEE6Galleria" buildafterfailed="true">
        <currentbuildstatuslistener file="logs/${}/status.txt"/>

    <!-- Defines where cruise looks for changes, to decide whether to run the build -->
        <mercurial localWorkingCopy="checkout/${}" hgcommand="log" />

    <!-- Configures the actual build loop, how often and which build file/target -->
    <schedule interval="60">
		<!-- Call the target that does everything -->
			<!-- Invoke 'hg update' in the CC copy of the Hg repository as the mercurial task in the modification set does not issue 'hg update' (what a bummer) -->
			<exec workingdir="checkout/${}"
			<maven2 mvnhome="D:\Apps\apache-maven-3.0.3"
				   goal="clean install" activateprofiles="integration-test" />

    <!-- directory to write build logs to -->
    <log dir="logs/${}">
        <merge dir="checkout/${}/galleria-ejb/target/surefire-reports" />
        <merge dir="checkout/${}/galleria-ejb/target/failsafe-reports" />
        <merge dir="checkout/${}/galleria-jsf/target/failsafe-reports" />

    <!-- Publishers are run *after* a build completes -->
            <artifactspublisher dest="artifacts/${}" file="projects/${}/target/${}.jar"/>

This assumes that the project was checked out using Mercurial into the checkout subdirectory.

Since the <mercurial> task in CC issues only a 'hg incoming', and does not follow it with a 'hg pull', we have to pull the fresh repository contents ourselves (see the 'exec' element).

A build of the project creates Maven Surefire and FailSafe reports, that can be merged into the build log.