Monday, January 25, 2010

Cruisecontrol and default contexts

Any programmer knows about Cruisecontrol and more in general about the concepts of Continuous Integration. Or at least they should.

The latest release of Cruisecontrol opens up the Jetty configuration completely, which is awesome, since you get a free complete webserver with it, which can handle publushing of files on HTTP. Awesome.

There are some issues, sure. Like for an example the standard Cruisecontrol deployment (binary form) doesn't define any default contexts in the jetty configuration. Which means once you start Cruisecontr0l, you won't have a default homepage setup (by default).

Well, there is an easy fix for that.

First, in the Cruisecontrol home (for example C:\cruisecontrol) create a directory "contexts".

Second, follow this snippet (just highlight & copy):

<?xml version="1.0"

<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="contextPath"><Property name="foo"/></Set>

<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/test</Set>

Restart your Cruisecontrol, open up a webbrowser and navigate to http://localhost:80 and voilá.