How to set class path in build.xml?

HI,

I am getting the following error in my build.xml while compiling struts framework. -

I guess it is because of not setting up class path - weblogic.jar in build.xml.

Here is my code for build.xml

<project name="TM" default="all" basedir=".">

<target name="init">

<property name="dirs.base" value="${basedir}"/>

<property name="classdir" value="${dirs.base}/WEB-INF/classes"/>

<property name="images" value="${dirs.base}/images"/>

<property name="src" value="${dirs.base}/src"/>

<property name="scripts" value="${dirs.base}/scripts"/>

<property name="lib" value="${dirs.base}/WEB-INF/lib"/>

<property name="styles" value="${dirs.base}/styles"/>

<property name="jsp's" value="${dirs.base}/WEB-INF/JSP/"/>

<property name="deploymentdescription" value="${dirs.base}/WEB-INF/"/>

<property name="warFile" value="grems.war"/>

</target>

<!-- copy all the .class files into classes/com/grems/struts directory -->

<target name="srccopy">

<javac srcdir="${src}" destdir="${classdir}" debug="true" />

</target>

<!-- Main target -->

<target name="all" depends="init,buildWar,clean,srccopy"/>

<!-- Create the War File -->

<target name="buildWar" depends="init">

<copy todir="${warFile}/WEB-INF/classes/com/grems/struts">

<fileset dir="${classdir}" />

</copy>

<copy todir="${warFile}/WEB-INF">

<fileset dir="${deploymentdescription}" includes="*.*" />

</copy>

<copy todir="${warFile}/images">

<fileset dir="${images}" />

</copy>

<copy todir="${warFile}/WEB-INF/lib">

<fileset dir="${lib}" />

</copy>

<copy todir="${warFile}/">

<fileset dir="" includes="*.*" />

</copy>

<copy todir="${warFile}/WEB-INF">

<fileset dir="" includes="*.*" />

</copy>

<copy todir="${warFile}/WEB-INF/JSP">

<fileset dir="${jsp's}" />

</copy>

<copy todir="${warFile}/scripts">

<fileset dir="${scripts}" />

</copy>

<copy todir="${warFile}/styles">

<fileset dir="${styles}" />

</copy>

<!-- Create war file and place in autodeploy directory -->

<jar jarfile="C:\bea\weblogic92\samples\domains\wl_server\autodeploy/${warFile}" basedir="${warFile}" />

</target>

<target name="clean" depends="buildWar" description="Clean build directory tree">

<delete dir="${dirs.base}/grems.war"/>

</target>

<!-- Create the War File -->

<!-- Create ear file and place in ear directory -->

</project>

[2968 byte] By [PaviEluri20a] at [2007-11-27 7:05:45]
# 1

Here is the answer-

http://www.globus.org/mail_archive/gridshib-commit/2007/02/msg00061.html

and ctrl+F = classpath- copy the code and paste it in your build. xml file.

After that - copy all the .jar files asscociated with struts (seven for me) and paste them in ant-home/lib directory.

Run the build.xml and u should be good.

PaviEluri20a at 2007-7-12 18:56:59 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Classpath in build.xml is set with the path element.

<path id="project.class.path">

<pathelement location="${classes.dir}" />

<fileset dir="${hibernate}">

<include name="hibernate2.jar"/>

</fileset>

<fileset dir="${hibernate}/lib">

<include name="*.jar"/>

</fileset>

<fileset dir="${hibernate.extensions}/lib">

<include name="*.jar"/>

</fileset>

<fileset dir="${hibernate.extensions}">

<include name="hibernate-tools.jar"/>

</fileset>

<fileset dir="${jdbc}/lib">

<include name="classes12.jar"/>

</fileset>

</path>

Specify the classpath for a taskdef with the classpathref attribute of the taskdef element.

<taskdef name="javaGen"

classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask"

classpathref="project.class.path"/>

dvohra09a at 2007-7-12 18:56:59 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...