troubleshooting Question

Classpath error when calling ant from cruisecontrol

Avatar of ssherlock
ssherlock asked on
ProgrammingJavaWeb Applications
4 Comments1 Solution411 ViewsLast Modified:
Using CruiseControl to build a web service I have the following in the build script to get the version of the build so that a directory can be built (named that version number) and the EAR file stored there.  This is so we can quickly get a archived builds (rather than extract from VSS by label and rebuild).
The question is how to get at a class within the WAR (that is already in the EAR)?  I am getting classpath errors with the following:
<!-- The following works fine and creates the GetVersion.class file, which is stored in the war file -->
<mkdir dir="src/appl/version"/>
<exec dir="src/appl/version" executable="cmd" output="src/appl/version/GetVersion.java" >
  <arg line="/c echo package appl.version; import appl.common.util.Utils; public class GetVersion { public static void main(String[] args) { System.out.println(Utils.VERSION); } }"/>
</exec>
<ant antfile="build.xml" target="build_all"/>

<!-- The following fails due to a classpath error -->
<java classname="appl.version.GetVersion" outputproperty="dcp.version"/>

<!-- Any reference to dcp.version just adds ${dcp.version} rather than the hoped for version number -->
<vsslabel serverpath="S:/AppData/CH/AppDev/LWS/SourceSafe" vsspath="${vss.project}" label="Client ${dcp.version}" />
<mkdir dir="S:/AppData/CH/AppDev/Web service builds/DebitCardPaymentServerV002/${dcp.version}" />
<copy file="DebitCardPaymentServer.earV002.Prod" tofile="S:/AppData/CH/AppDev/Web service builds/DebitCardPaymentServerV002/${dcp.version}/DebitCardPaymentServer.earV002.Prod"/>
<copy file="DebitCardPaymentServer.earV002.UAT" tofile="S:/AppData/CH/AppDev/Web service builds/DebitCardPaymentServerV002/${dcp.version}/DebitCardPaymentServer.earV002.UAT"/>
ASKER CERTIFIED SOLUTION
Mick Barry
Java Developer
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros