You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Br...@infinium.com on 2003/01/14 21:02:03 UTC

Running Ant Headless with

Hello,


I am experiencing something weird when running Ant headless with WSAD.  I
am using WSAD 4.02, Ant version 1.4.1 (under WSAD plugins), and the runAnt
extras provided by IBM.  I have 13 build files that can be run
indepedently.  Each file executes perfectly fine when run stand alone.
Now, I have created a "master" build file that will act as the driver and
execute each separate build file based on an order specified.  When I use
this method of calling the sub-build files I am receiving several different
errors (see items 3 and 4 below).



------------------------------------------------------------------------------------------------------------------------

(1)  Here is the driver build.xml file:



<?xml version="1.0"?>

<!-- ///////////////////////////////////////////////////////////////////
-->
<!-- BuildAll.xml file for compiling entire project -->
<!-- ///////////////////////////////////////////////////////////////////
-->

<project name="Build" default="buildAll" basedir=".">

      <target name="buildAll">
            <property name="buildAllLogFile" value="
${basedir}/buildAll.log" />
            <record name="${buildAllLogFile}" loglevel="debug" action
="start"/>

            <ant antfile="101_build_ViewControllerInterfaces.xml" dir
="viewcontrollerinterfaces" target="buildProject"/>

            <record name="${checkoutLogFile}" action="stop"/>
      </target>

</project>
------------------------------------------------------------------------------------------------------------------------

(2)  Here is the ViewControllerInterfaces.xml build file:


<?xml version="1.0"?>

<!-- ///////////////////////////////////////////////////////////////////
-->
<!-- Build.xml file for exporting the JAR ViewControllerInterfaces.jar -->
<!-- ///////////////////////////////////////////////////////////////////
-->

<project name="Build" default="buildProject" basedir=".">

<!-- Global settings -->
<property name="debug.flag" value="off"/>
<property name="deprecation.flag" value="off"/>
<property name="java.lib" value="${java.home}/jre/lib/rt.jar"/>
<property name="antextras.jar" value
="c:/wsad/plugins/com.ibm.ant.extras/antextras.jar"/>
<property name="antj2ee.jar" value
="c:/wsad/plugins/com.ibm.etools.j2ee.extras/antj2ee.jar"/>

<!-- Global "magic" property for <javac> -->
<!-- Do not use the value of "modern" when compiling projects in WSAD -->
<property name="build.compiler" value
="org.eclipse.pde.internal.core.JDTCompilerAdapter"/>

      <!-- Retrieve project data for use in building the JAR file -->
      <target name="getData" description="Retrieve data from current
project.">
            <getProjectData  Basedir="${basedir}" />
            <echo message="getProjectData: projectName=${projectName}
              nature=${natureName} workspace=${workspaceName}
              basedir=${basedir}" />
      </target>

      <target name="buildProject" depends="getData">
            <property name="logFile" value="${basedir}/${projectName}.log"
/>
            <record name="${logFile}" loglevel="debug" action="start"/>

            <utilJar EARProjectName="InfiniumApps_SelfService"
JavaProjectName="ViewControllerInterfaces" Jar
="ViewControllerInterfaces.jar"
IncludeBinary="true" IncludeSource="false" />

            <record name="${logFile}" action="stop"/>
      </target>
</project>

------------------------------------------------------------------------------------------------------------------------

(3)  If I execute the above build files I receive the following error:


Task Failed exception=C:
\wsad\workspace\viewcontrollerinterfaces\101_build_ViewC
ontrollerInterfaces.xml:32: Could not create task of type: getProjectData.
Commo
n solutions are to use taskdef to declare your task, or, if this is an
optional
task, to put the optional.jar in the lib directory of your ant installation
(ANT
_HOME). message=null


If I add the <taskdef> tag to the callee build file to define the
'getProjectData' task the error goes away.

      <taskdef name="getProjectData" classname
="com.ibm.ant.extras.GetProjectData" classpath="${antextras.jar}"/>

However, I now receive an error based upon the 'utilJar' task in the
'buildProject' target.  So, I figure if I add a <taskdef> tag to define the
'utilJar' class I could get past that error.

I added the following line to the ViewControllerInterfaces.xml build file:

      <taskdef name="utilJar" classname
="com.ibm.etools.j2ee.extras.BuildApplicationUtilJar" classpath="
${antj2ee.jar}"/>


------------------------------------------------------------------------------------------------------------------------

(4) If I execute the build files with the latest taskdef changes I receive
the following error:



Task Failed exception=C:
\wsad\workspace\viewcontrollerinterfaces\101_build_ViewC
ontrollerInterfaces.xml:42: Could not create task of type: utilJar due to
java.l
ang.NoClassDefFoundError:
com/ibm/etools/archive/j2ee/operations/J2EELoadStrateg
yImpl message=null

------------------------------------------------------------------------------------------------------------------------

My question is, why does the independent build file execute successfully
without the <taskdef> declarations when run stand alone but fail when
called by another Ant build file?  The <ant> tag used to call the
independent build file is pretty straight forward Ant syntax (see item 1)

I've gone so far as to place the antextras.jar and antj2ee.jar files in the
'org.eclipse.ant.core' folder under WSAD/plugins and add entries to the
'org.eclipse.ant.core' plugin.xml file.  No success.  I also added the two
files to the CLASSPATH and PATH system environment variables with no
success.

Any help would be greatly appreciated.

Thanks,
Bruce Slater




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>