Using starteam with CruiseControl
Quick Start:
- Find the starteam-sdk.jar – typically located in <Your StarTeam Client Install Dir>/StarGate SDK/ or <Your StarTeam Client Install Dir>/lib and named either starteam-sdk.jar or starteamXX.jar, where XX is a version number.
- Copy this jar to the CruiseControl /main/lib/ directory (renaming it to starteam-sdk.jar, if needed)
- If you want encryption support, also copy ss.jar, starteam-extensions.jar, jsafe.jar and jsafePure.zip.
- Now run the CruiseControl "build" command to build the CruiseControl Jar with StarTeam classes/functionality on board.
- That should be it!
Example on how to get your build.xml to match your StarTeam set-up
When I open my Star Team, I select the project "J Projects" and then the view "J Projects". I put the project/view information in the starteamurl property after the ip address and port: starteamurl="192.160.100.70:49201/J Projects/J Projects".
Now that my view is open, I see a directory structure that looks like this:
The J Projects is actually the view, so I skip that. So my root folder is cruisebuild\src. This goes in my build.xml as folder="cruisebuild\src".
So my build.xml has the following modificationset:
<modificationset quietperiod="30" dateformat="yyyy-MMM-dd HH:mm:ss">
<starteam username="jisgreat" password="makeapasswordhere" folder="cruisebuild\src"
starteamurl="192.160.100.70:49201/J Projects/J Projects" />
</modificationset>
Troubleshooting
Error message while setting up starteam-sdk.jar
While installing CC I realized that it needed the starteam-sdk.jar file. I put that in the CC lib directory and then got the error message below.
I did some more digging. First I looked in the StarTeam specific .java files that ship with CC. There was nothing in there regarding StarTeam version compatibility. Then I went looking into various .jar files. It turns out that class files in starteam-sdk.jar are now included in starteam54.jar. When I put starteam54.jar into the CC lib directory and modified the cruisecontrol.bat file to specify this on the classpath, that seems to fix the problem.
Problem setting up the root folder
If you set the root folder incorrectly (e.g. if you set it to folder="J Projects\cruisebuild\src" in the example above), you get this cryptic error:
Try resetting your folder property using the above instructions ("Example on how to get your build.xml to match your StarTeam set-up") until you get it right.
If you want to check against the whole contents of "J Projects", not a subfolder, set it to folder="". You cannot omit folder option.
NOTE: Do not designate a specific folder if you want to start at root level.
<modificationset requiremodification="true" quietperiod="30">
<starteam username="myname" password="abc123" folder=""
starteamurl="stservername:49201/Project/View" />
</modificationset>
Using starteam with Ant
You will sometimes need to use StarTeam inside ant as part of your bootstrapping, build or publishing phase. This will require you to make some files (a jar and perhaps a dll) available to your build script environment. One thing to not overlook is that the default ant version distributed inside CruiseControl isn't configured to run optional tasks by default. So if you plan to use this version of ant, you will need to configure it prior usage.
We advise you to look at your StarTeam documentation to fully use StarTeam with ant.
I found one issue with the building of the cruisecontrol.jar and one issue running cruiscontrol while using "StarTeam SDK 2005 R2". The following files must be edited to match the version of Starteam SDK.
#1. C:[INSTALL_PATH]\cruisecontrol-2.3.1\main\build.xml
*The starteam-sdk.jar must be changed to the name of the jar being placed into "\main\lib".
See corrected line below.
(correct) available file="lib/starteam80.jar" property="starteam-sdk-present
(incorrect) available file="lib/starteam-sdk.jar" property="starteam-sdk-present
#2. C:[INSTALL_PATH]\cruisecontrol-2.3.1\main\bin\cruisecontrol.bat
*(INCORRECT - See "LIBDIR%\starteam-sdk.jar;")
set CRUISE_PATH=%CRUISE_PATH%;%DISTDIR%\cruisecontrol.jar;%LIBDIR%\log4j.jar;%LIBDIR%\jdom.jar;%LIBDIR%\ant\ant.jar;%LIBDIR%\ant\ant-launcher.jar;%LIBDIR%\xercesImpl-2.7.0.jar;%LIBDIR%\xml-apis-2.7.0.jar;%LIBDIR%\xalan-2.6.0.jar;%LIBDIR%\jakarta-oro-2.0.3.jar;%LIBDIR%\mail.jar;%LIBDIR%\junit.jar;%LIBDIR%\activation.jar;%LIBDIR%\commons-net-1.1.0.jar;%LIBDIR%\starteam-sdk.jar;%LIBDIR%\mx4j.jar;%LIBDIR%\mx4j-tools.jar;%LIBDIR%\mx4j-remote.jar;%LIBDIR%\smack.jar;%LIBDIR%\comm.jar;%LIBDIR%\x10.jar;%LIBDIR%\fast-md5.jar;.
*(CORRECT - See "LIBDIR%\starteam80.jar")
set CRUISE_PATH=%CRUISE_PATH%;%DISTDIR%\cruisecontrol.jar;%LIBDIR%\log4j.jar;%LIBDIR%\jdom.jar;%LIBDIR%\ant\ant.jar;%LIBDIR%\ant\ant-launcher.jar;%LIBDIR%\xercesImpl-2.7.0.jar;%LIBDIR%\xml-apis-2.7.0.jar;%LIBDIR%\xalan-2.6.0.jar;%LIBDIR%\jakarta-oro-2.0.3.jar;%LIBDIR%\mail.jar;%LIBDIR%\junit.jar;%LIBDIR%\activation.jar;%LIBDIR%\commons-net-1.1.0.jar;%LIBDIR%\starteam80.jar;%LIBDIR%\mx4j.jar;%LIBDIR%\mx4j-tools.jar;%LIBDIR%\mx4j-remote.jar;%LIBDIR%\smack.jar;%LIBDIR%\comm.jar;%LIBDIR%\x10.jar;%LIBDIR%\fast-md5.jar;.
Links
http://www.borland.com/starteam/
http://cruisecontrol.sourceforge.net/main/configxml.html#starteam
http://ant.apache.org/manual/OptionalTasks/starteam.html