1. Use the <svn> element in your config.xml.
If you are using a version of Cruise Control below 2.1.6, you must register the SVN plugin (Subversion is not supported below version 2.1.4).
Inside your <project> element, add the SVN plugin:
<plugin name="svn" classname="net.sourceforge.cruisecontrol.sourcecontrols.SVN"/>
There is also an SVN Bootstrapper you can use:
<plugin name="svnbootstrapper" classname="net.sourceforge.cruisecontrol.bootstrappers.SVNBootstrapper"/>
Use the <svn> element inside the <modificationset> element:
<modificationset quietperiod="180">
<svn localWorkingCopy="checkout/trunk"/>
</modificationset>
The <svn> element supports the following attributes:
localWorkingCopy: The location where your checkout is located
repositoryLocation: The URL to use when making calls to Subversion. This is/may be optional depending on your configuration.
username: The username to connect to Subversion. Not required for anonymous repositories.
password: The password to connect to Subversion with. Not required for anonymous repositories.
2. Ant does not yet have an svn task, so you need to exec a command line to do in your wrapper build file to update the repository.
<exec executable="svn">
<arg line="up"/>
</exec>
Make sure this command is executing inside your Subversion check out directory.
If you have problems
While configuring CC with Subversion, I got the following exception:
[cc]Jul-20 12:16:16 SVN - Error executing svn log command
org.jdom.JDOMException: Error on line 3: The element type "log" must be terminated by the matching end-tag "</log>".
at org.jdom.input.SAXBuilder.build(SAXBuilder.java(Compiled Code))
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:650)
at net.sourceforge.cruisecontrol.sourcecontrols.SVN$SVNLogXMLParser.parse(SVN.java:304)
at net.sourceforge.cruisecontrol.sourcecontrols.SVN$SVNLogXMLParser.parseAndFilter(SVN.java:289)
at net.sourceforge.cruisecontrol.sourcecontrols.SVN.parseStream(SVN.java:277)
at net.sourceforge.cruisecontrol.sourcecontrols.SVN.execHistoryCommand(SVN.java:258)
at net.sourceforge.cruisecontrol.sourcecontrols.SVN.getHeadRevision(SVN.java:198)
at net.sourceforge.cruisecontrol.sourcecontrols.SVN.getModifications(SVN.java:183)
at net.sourceforge.cruisecontrol.ModificationSet.getModifications(ModificationSet.java:146)
This was caused by an incorrect SVN command line. Tweak your <svn> target's parameters to try to fix it (I removed repositoryLocation to make it work) .
Please update this article! Subversion already have ant task for SVN operations: http://subclipse.tigris.org/svnant.html Witt this task integration will be more usable.
I have an established CruiseControl environment that handles buids for 3 projects. Until recently, all 3 of them were CVS-based, but now one of them has made the switch to Subversion. I used the <modificationset> as shown above, referencing my local working copy. It does indeed kick off a build every time a modification has been made to the project in the svn repository, but the problem is that it kicks off a build of my project whenever ANYTHING in the repository has changed. Since there are other projects in the same svn repository, this is a major problem for us. My local working copy was not a checkout of the entire repository, but just of the stuff under my project subtree.
Any ideas?
<modificationset quietperiod="180">
<svn localWorkingCopy="checkout/trunk"/>
</modificationset>
You'll have better luck asking the question on the user mailing list instead of the wiki...
Exption executing while run CC with svn .How will i handle this exception:
XXX....IOException: CreateProcess: svn update --non --interactive --username=12345 passord=12345 error:2
....................................
CruiseControlException:Error executing svn update command
IOException: CreateProcess: ... error:2 on Windows always means that the executable is not on your path.
Add the svn exectuable to your path and you should be good.