Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

BUILD FAILED in Build.xml

 
Khirod Patra
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all The Member.

When I trying to run ant from the eclipse editor, it generate error the on specific two lines in Build.xml file i.e

1)<antcall target="createBuildDirectory"/>

2)<untar src="${jakarta.taglib}" dest="build" compression="gzip"/>

That is -------->

BUILD FAILED
/home/khirod/Desktop/bug895 /cs-apd/build.xml:86: The following error occurred while executing this line:
/home/khirod/Desktop/bug895 /cs-apd/build.xml:103: Error while expanding /home/khirod/Desktop/download/apache.org/jakarta-taglibs-standard-current.tar.gz


The Build.xml file:---

<project name="XXXXXXXXX" default="build" basedir=".">

<property name="XXXXXXXX_logo"
value="usr/doc-src/XXXXXXXXX_logo_trans.jpg"/>

<property name="checkstyle"
value="../../download/checkstyle.sf.net/checkstyle-3.4.tar.gz"/>

<property name="dbunit"
value="../../download/dbunit.org/dbunit-2.0.zip"/>

<property name="httpunit"
value="../../download/httpunit.sf.net/httpunit-1.5.4.zip"/>

<property name="postgresql.connector"
value="../../download/postgresql.org/pg74jdbc2.jar"/>

<property name="jakarta.taglib"
value="../../download/apache.org/jakarta-taglibs-standard-current.tar.gz"/>

<property name="jfreechart"
value="../../download/jfree.org/jfreechart-0.9.21.tar.gz"/>

<property name="javamail.jar"
value="../../download/tjmail.sf.net/javamail.jar"/>

<property name="itext.jar"
value="../../download/lowagie.com/itext-1.2.jar"/>

<path id="itext-cp">
<fileset file="${itext.jar}"/>
</path>

<path id="servlet-cp">
<fileset dir="../../download/sun.com" includes="woody-servlet-2.3.jar"/>
</path>

<path id="jfreechart-cp">
<fileset dir="build" includes="jfreechart-*/*.jar"/>
<fileset dir="build" includes="jfreechart-*/lib/*.jar"/>
</path>

<path id="taglib-cp">
<fileset dir="build" includes="jakarta-taglibs-standard-*/lib/*.jar"/>
</path>

<path id="hibernate-cp">
<fileset dir="../../lib" includes="hibernate/*.jar"/>
<fileset dir="../../lib" includes="hibernate-annotations/*.jar"/>
</path>

<path id="httpunit-cp">
<fileset dir="build" includes="httpunit-*/lib/httpunit.jar"/>
<fileset dir="build" includes="httpunit-*/jars/*.jar"/>
</path>

<path id="dbunit-cp">
<fileset dir="build" includes="dbunit-*/dbunit-*.jar"/>
</path>

<path id="checkstyle-cp">
<fileset dir="build" includes="checkstyle-*/checkstyle-*.jar"/>
</path>

<path id="tomcat-cp">
<fileset dir="/usr/share/tomcat4/lib" includes="*.jar"/>
</path>

<path id="postgresql-cp">
<fileset file="${postgresql.connector}"/>
</path>

<path id="javamail-cp">
<fileset file="${javamail.jar}"/>
</path>

<path id="common-cp">
<pathelement path="."/>
<pathelement path="src"/>
<pathelement path="build/classes"/>
</path>

<target name="init">

<available property="buildDirectoryExists" file="build" type="dir"/>
<antcall target="createBuildDirectory"/>

<taskdef resource="checkstyletask.properties">
<classpath refid="checkstyle-cp"/>
</taskdef>

</target>


<target name="createBuildDirectory" unless="buildDirectoryExists">

<mkdir dir="build"/>
<mkdir dir="build/classes"/>
<mkdir dir="build/war"/>
<mkdir dir="build/war/WEB-INF"/>
<mkdir dir="build/javadoc"/>

<untar src="${jakarta.taglib}" dest="build" compression="gzip"/>
<untar src="${jfreechart}" dest="build" compression="gzip"/>
<untar src="${checkstyle}" dest="build" compression="gzip"/>
<unzip src="${httpunit}" dest="build"/>
<unzip src="${dbunit}" dest="build"/>

<copy todir="build/war/WEB-INF">
<fileset dir="war/WEB-INF" includes="web.xml"/>
<fileset dir="war/WEB-INF" includes="cs.tld"/>
<fileset dir="build/jakarta-taglibs-standard-1.0.4/tld" includes="*.tld"/>
</copy>

<!-- This hack allows tomcat4 to map the welcome-file to a servlet -->
<touch file="build/index.jsp"/>

</target>


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

<javac srcdir="src" destdir="build/classes" debug="true" fork="true" deprecation="yes">
<classpath refid="dbunit-cp"/>
<classpath refid="common-cp"/>
<classpath refid="servlet-cp"/>
<classpath refid="httpunit-cp"/>
<classpath refid="javamail-cp"/>
<classpath refid="jfreechart-cp"/>
<classpath refid="itext-cp"/>
<classpath refid="taglib-cp"/>
<classpath refid="hibernate-cp"/>
</javac>

</target>


<target name="testCompileJSP">

<uptodate property="JSPuptodate">

<srcfiles dir="war" includes="**/*.jsp"/>

<mapper type="glob" from="*.jsp" to="../build/war/*.jsp"/>

</uptodate>

</target>


<!-- <target name="compileJSP" depends="init, testCompileJSP" unless="JSPuptodate"> -->
<target name="compileJSP" depends="init, testCompileJSP">

<copy todir="build/war">
<fileset dir="war" includes="**/*.jsp"/>
</copy>


<jspc srcdir="build/war"
destdir="build/war"
webinc="build/web.jsp.xml"
verbose="2">

<webapp basedir="build/war"/>

<classpath refid="servlet-cp"/>
<classpath refid="taglib-cp"/>
<classpath refid="tomcat-cp"/>
<classpath path="build/classes"/> <!-- makes our taglib visible at buildtime -->
</jspc>

<javac srcdir="build/war" destdir="build/war" debug="true" fork="true" deprecation="yes">

<include name="**/*.java"/>

<!-- The following does not need to be compiled independently -->
<exclude name="menu.java"/>
<exclude name="**/tabs.java"/>
<exclude name="titlebar.java"/>

<classpath refid="common-cp"/>
<classpath refid="servlet-cp"/>
<classpath refid="tomcat-cp"/>
<classpath refid="taglib-cp"/>
</javac>

<!-- Insert the JSP mappings into web.xml -->
<copy todir="build/war/WEB-INF" overwrite="true">
<fileset dir="war/WEB-INF" includes="web.xml"/>
</copy>

<loadfile property="jspc.webxml" srcFile="build/web.jsp.xml"/>
<replace file="build/war/WEB-INF/web.xml">
<replacefilter token="<!-- @JSPC-INSERT-HERE@ -->" value="${jspc.webxml}"/>
</replace>



</target>

<target name="war" depends="compile, compileJSP">

<war destfile="build/cs-apd-console.war" webxml="build/war/WEB-INF/web.xml">

<classes dir="build/classes"
includes="**/*.class"
excludes="test/**/*.class"/>

<classes dir="build/war" includes="**/*.class"/>

<classes file="${countersnipe_logo}"/>

<lib dir="build/jfreechart-0.9.21" includes="jfreechart-0.9.21.jar"/>
<lib dir="build/jfreechart-0.9.21/lib" includes="jcommon-0.9.6.jar"/>

<lib dir="build/jakarta-taglibs-standard-1.0.4/lib" includes="*.jar" excludes="jaxp-api.jar dom.jar sax.jar xercesImpl.jar"/>

<lib file="${javamail.jar}"/>

<lib file="${itext.jar}"/>

<fileset dir="war">
<include name="**/*.css"/>
<include name="**/*.gif"/>
<include name="**/*.png"/>
<include name="**/*.ico"/>
</fileset>

<fileset dir="build" includes="index.jsp"/>

</war>

<mkdir dir="build/cs-apd-console"/>
<unwar src="build/cs-apd-console.war" dest="build/cs-apd-console" />

</target>


<target name="clean">
<delete dir="build"/>
</target>

<target name="build" depends="clean, war">
</target>


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

<javadoc
packagenames="*"
destdir="build/javadoc"
author="true"
version="true"
use="true"
windowtitle="Countersnipe Java API"
sourcepath="src">

</javadoc>
</target>

<target name="test" depends="war">

<java
className="test.Test"
fork="yes">

<classpath refid="dbunit-cp"/>
<classpath refid="httpunit-cp"/>
<classpath refid="postgresql-cp"/>
<classpath refid="common-cp"/>
</java>
</target>


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

<checkstyle
config="checkstyle.xml"
failOnViolation="false">

<fileset dir="src" includes="**/*.java"/>
<formatter type="plain"/>
<formatter type="xml" toFile="build/checkstyle.xml"/>
</checkstyle>

<style
in="build/checkstyle.xml"
out="build/checkstyle.html"
style="build/checkstyle-3.4/contrib/checkstyle-noframes-sorted.xsl"/>

</target>

</project>



Regards
Khirod Patra
[ June 11, 2008: Message edited by: Khirod Patra ]
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Running Ant with the -v flag should give you the full exception stack trace, which *might* give you more information on what did go wrong.

Do you have any problem untaring the file manually?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic