You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by yangyuexiang <ya...@comp.nus.edu.sg> on 2000/09/06 07:02:06 UTC

build.xml problem need help

Hi

After I ran build, I found all directories were created under wepapps.
But I found the classes compiled did not be copied to the corresponding
directory. My source files are
organized into packages under src directory.

The build and     build.xml file were attached.

The following is the results displayed when  I run build script.

Thanks for you help!
yx

$ su -c "build"
Password:
Buildfile: build.xml
Project base dir set to: /home/yuexiang/working/msproject
Executing Target: prepare
Created dir: /opt/tomcat/webapps/packing
Copying 54 files to /opt/tomcat/webapps/packing
Created dir: /opt/tomcat/webapps/packing/WEB-INF
Created dir: /opt/tomcat/webapps/packing/WEB-INF/classes
Created dir: /opt/tomcat/webapps/packing/WEB-INF/classes/packing
Created dir: /opt/tomcat/webapps/packing/WEB-INF/classes/packing/log
Created dir: /opt/tomcat/webapps/packing/WEB-INF/classes/packing/gui
Created dir: /opt/tomcat/webapps/packing/WEB-INF/lib
Copying 2 files to /opt/tomcat/webapps/packing/WEB-INF/lib
Created dir: /opt/tomcat/webapps/packing/javadoc
Executing Target: compile
Compiling 9 source files to /opt/tomcat/webapps/packing/WEB-INF/classes
Performing a Modern Compile
Copying 1 support files to /opt/tomcat/webapps/packing/WEB-INF/classes
Completed in 1 seconds

Thanks
yang




build script: --------------------------------

#!/bin/sh
# build -- Build Script for "My Application"
# $Id: source.html,v 1.2 2000/03/28 00:44:11 craigmcc Exp $

# Identify the custom class path components we need
CP=$TOMCAT_HOME/classes:$TOMCAT_HOME/lib/ant.jar:$TOMCAT_HOME/lib/xml.jar

CP=$CP:$TOMCAT_HOME/lib/jasper.jar:$TOMCAT_HOME/lib/servlet.jar
CP=$CP:$TOMCAT_HOME/lib/webserver.jar

# Execute ANT to perform the requested build target
java -Dtomcat.home=$TOMCAT_HOME -classpath $CP:$CLASSPATH \
   org.apache.tools.ant.Main "$@"


build.xml ----------------------------------------------

<!-- A "project" describes a set of targets that may be requested
     when Ant is executed.  The "default" attribute defines the
     target which is executed if no specific target is requested,
     and the "basedir" attribute defines the current working directory
     from which Ant executes the requested task.  This is normally
     set to the current working directory.
-->


<project name="packing" default="compile" basedir=".">


<!-- Property Definitions

     Each of the following properties are used by convention in this
     build file.  The values specified can be overridden at run time by
     adding a "-Dname=value" argument to the command line that invokes
Ant.
     This technique is normally used to copy the values of the ANT_HOME
     and TOMCAT_HOME environment variables into the "ant.home" and
     "tomcat.home" properties, which are normally not defined
explicitly.

     app.name          Base name of this application, used to
                       construct filenames and directories.

     deploy.home       The name of the directory into which the
                       deployment hierarchy will be created.
                       Normally, this will be the name of a
                       subdirectory under $TOMCAT_HOME/webapps.

     dist.home         The name of the base directory in which
                       distribution files are created.

     dist.src          The name of the distribution JAR file
                       containing the application source code,
                       to be stored in the "dist.home" directory.
                       This filename should end with ".jar".

     dist.war          The name of the Web ARchive (WAR) file
                       containing our deployable application.
                       This filename should end with ".war".

     javadoc.home      The name of the base directory in which
                       the JavaDoc documentation for this application
                       is generated.

     tomcat.home       The name of the base directory in which
                       Tomcat has been installed.  This value is
                       normally set automatically from the value
                       of the TOMCAT_HOME environment variable.

     In the example below, the application being developed will be
deployed
     to a subdirectory named "myapp", and will therefore be accessible
at:

       http://localhost:8080/myapp
-->

  <property name="app.name"       value="packing"/>
  <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"/>
  <property name="build.compiler" value="modern"/>

<!-- The "prepare" target is used to construct the deployment home
     directory structure (if necessary), and to copy in static files
     as required.  In the example below, Ant is instructed to create
     the deployment directory, copy the contents of the "web/" source
     hierarchy, and set up the WEB-INF subdirectory appropriately.
-->


Re: build.xml problem need help

Posted by Stefan Bodewig <bo...@bost.de>.
Hi yang,

>Performing a Modern Compile
>Copying 1 support files to /opt/tomcat/webapps/packing/WEB-INF/classes
>Completed in 1 seconds

this looks a lot like the "Ant doesn't compile when running JDK 1.3"
bug that has been fixed about 4 months ago. Please install Ant 1.1 and
try again, this should work now.

Stefan