Recently I set up CruiseControl with ClearCase. While there are a few postings around the blogosphere that cover some of this, I thought I’d blog it here also. More information, the better is for others to find it.
Refer to my earlier email on CruiseControl Setup for basic CruiseControl instructions. Below are the changes you need to make to get it working with ClearCase (with Maven build). Of course its up to you to actually install the ClearCase client and make sure you are able to checkout code outside of CruiseControl.
Below is the updated project configuration file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
<project name="myproject" buildafterfailed="true"> <plugin name="clearcase" classname="net.sourceforge.cruisecontrol.sourcecontrols.ClearCase" /> <listeners> <currentbuildstatuslistener file="logs/myproject/status.txt" /> </listeners> <bootstrappers> </bootstrappers> <!-- Defines where cruise looks for changes, to decide whether to run the build --> <modificationset quietperiod="10"> <!--ucm stream="dev" viewpath="C:\projects\dev\myproject" contributors="true"/ --> <clearcase branch="dev" viewpath="C:\projects\dev\myproject" recursive="true" /> </modificationset> <!-- Configures the actual build loop, how often and which build file/target --> <schedule interval="1800"> <maven2 mvnscript="C:\tools\maven-2.0.7\bin\mvn.bat" pomfile="C:\projects\dev\myproject\pom.xml" goal="scm:update | clean test"> <property name="VIEW_HOME" value="C:\projects\dev" /> .... other properties to pass to maven ... </maven2> </schedule> <log dir="logs/myproject" encoding="UTF-8"> </log> <publishers> <currentbuildstatuspublisher file="logs/myproject/buildstatus.txt" /> <artifactspublisher dir="checkout/myproject/report" dest="artifacts/myproject" /> <htmlemail mailhost="mailserver.yourcompany.com" returnaddress="buildmanager@yourcompany.com" reportsuccess="fixes" subjectprefix="myproject Build Results" buildresultsurl="http://yourcompany.com:12000/cruisecontrol/buildresults/myproject" skipusers="false" spamwhilebroken="false" css="webapps/cruisecontrol/css/cruisecontrol.css" xsldir="webapps/cruisecontrol/xsl" logdir="logs/myproject"> <success address="devmailinglist@yourcompany.com" /> <failure address="devmailinglist@yourcompany.com" /> </htmlemail> </publishers> </project> |
I am not going to explain the file in any detail. Things should be self-explanatory. With Maven I needed to do one more addition to my pom.xml
1 2 3 4 |
<scm> <connection>scm:clearcase:load c:/projects/dev</connection> </scm> |
Hopefully this helps someone out there. To give credit where credit is due. I did find Simon’s Blog entry helpful.