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"/>
it can't access the class from the war file.
you'll need to have a copy in some directory and specify that directory using the classpath parameter of the java task