Hi! It's me again.
I've managed to create the .war file. Now I have another problem. I believe
it's with configuring the build.xml file. My .war file only contains the web
files (i.e. the files directly in my ${deploy.home}dir), not files in the
subdirectories (web-inf for example) recursively.
My dist target in the build.xml file is as follows:
<target name="dist" depends="prepare,compile" init="init">
<jar jarfile="${dist.home}/${dist.src}"
basedir="." includes="*"/>
<jar jarfile="${dist.home}/${dist.war}"
basedir="${deploy.home}" includes="*"/>
</target>
What is wrong?
kim
----- Original Message -----
From: Kim <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 10, 2000 3:51 PM
Subject: Problem with creating WAR file
> I'm trying to create a WAR file for my web application using the
guidelines
> given in Tomcat's /doc/appdev/.
>
> I've managed to use the "build.bat" file to deploy my webapp files from
the
> project source dir. to the distribution dir. The problem is no .war file
is
> created.
>
> This is what i get when ANT is run:
> ~~~~~~~~~~~~~~~
> C:\war\news>java org.apache.tools.ant.Main -Dtomcat.home=c:\jakart~1
> Buildfile: build.xml
> Project base dir set to: C:\war\news
> Executing Target: prepare
> Created dir: C:\jakart~1\webapps\news
> Copying 27 files to C:\jakart~1\webapps\news
> Created dir: C:\jakart~1\webapps\news\WEB-INF
> Created dir: C:\jakart~1\webapps\news\WEB-INF\classes
> Created dir: C:\jakart~1\webapps\news\WEB-INF\lib
> Copying 1 files to C:\jakart~1\webapps\news\lib
> Created dir: C:\jakart~1\webapps\news\javadoc
> Executing Target: compile
> Copying 1 support files to C:\jakart~1\webapps\news\WEB-INF\classes
> Completed in 1 seconds
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> It seems that only 2 target from the build.xml file is executed (i.e
prepare
> & compile) although I have defined a "dist" target (& others as well).
This
> is my build.xml file:
>
> ~~~~~~~~~~~~~~~~~~~~~~
> <project name="News" default="compile" basedir=".">
>
> <!-- Simple "Hello, World" project to provide a concrete example of
> the recommendations in the Application Developer's Guide.
> NOTE: Before using this file as is, you should review the
> values for the properties that are defined below.
> In particular, it is assumed that you wish to install this
> application under context path "/myapp" in the Tomcat installation
> defined by your TOMCAT_HOME environment variable.
> -->
>
> <property name="app.name" value="news"/>
> <property name="deploy.home"
> value="${tomcat.home}/webapps/${app.name}"/>
> <property name="dist.home" value="${deploy.home}"/>
> <property name="dist.src" value="${app.name}.jar"/>
> <property name="dist.war" value="${app.name}.war"/>
> <property name="javadoc.home" value="${deploy.home}/javadoc"/>
>
> <target name="prepare" init="init">
> <mkdir dir="${deploy.home}"/>
> <copydir src="web" dest="${deploy.home}"/>
> <mkdir dir="${deploy.home}/WEB-INF"/>
> <copyfile src="etc/web.xml" dest="${deploy.home}/WEB-INF/web.xml"/>
> <mkdir dir="${deploy.home}/WEB-INF/classes"/>
> <mkdir dir="${deploy.home}/WEB-INF/lib"/>
> <copydir src="lib" dest="${deploy.home}/lib"/>
> <mkdir dir="${javadoc.home}"/>
> </target>
>
> <target name="clean" init="init">
> <deltree dir="${deploy.home}"/>
> </target>
>
> <target name="compile" depends="prepare" init="init">
> <javac srcdir="src" destdir="${deploy.home}/WEB-INF/classes"
> classpath="${deploy.home}/WEB-INF/classes"
> debug="on" optimize="off" deprecation="off"/>
> </target>
>
> <target name="javadoc" depends="prepare" init="init">
> <!-- TODO -->
> </target>
>
> <target name="all" depends="clean,prepare,compile,javadoc" init="init"/>
>
> <target name="dist" depends="prepare,compile" init="init">
> <jar jarfile="${dist.home}/${dist.src}"
> basedir="." includes="*"/>
> <jar jarfile="${dist.home}/${dist.war}"
> basedir="${deploy.home}" includes="*"/>
> </target>
>
> </project>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Please, somebody, help!!!! Why no .war file generated????
>
> kim.
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets