tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Horowitz <rhorow...@ni4u.com>
Subject Can't build tomcat3.1 sample with ANT
Date Mon, 22 May 2000 01:06:40 GMT
I'm trying to build the Hello.java sample in Tomcat 3.1 (in
%TOMCAT_HOME%\doc\appdev\sample) using ANT and cannot seem to get it
working.  I'm on NT 4.0 and have installed JDK 1.3.  Tomcat is installed
in d:\jakarta-tomcat.  I made some small changes to build.bat and
build.xml to work around other problems that I've experienced. I'm able
to run:

> build prepare

correctly, and I'm trying to run:

> build compile

As you can see from the output below, no error messages are displayed
from ANT or javac, but the Hello.class file is not created. 

Below is pasted my build.bat file, my build.xml file, and the output
from ANT running in verbose mode.  I'd really appreciate some help. 
I've read all the doc and can't figure this out. 

Thanks so much for your assistance

Rick Horowitz

********************************************
build.bat
********************************************

@echo off
rem build.bat -- Build Script for the "Hello, World" Application
rem $Id: build.bat,v 1.1 2000/04/04 22:01:13 craigmcc Exp $

echo ready to execute ant 1

goto noclasspath

:haveclasspath
echo ready to execute ant 2
set _CLASSPATH=%CLASSPATH%
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME\classes
goto restofclasspath

:noclasspath
echo ready to execute ant 3
set _CLASSPATH=
echo ready to execute ant 3b
set CLASSPATH=%TOMCAT_HOME%\classes

:restofclasspath
echo ready to execute ant 4
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\ant.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jar

echo ant classpath = %classpath%

rem Execute ANT to perform the requested build target
java org.apache.tools.ant.Main -verbose -Dtomcat.home=%TOMCAT_HOME% %1
%2 %3 %4 %5 %6 %7 %8 

%9

set CLASSPATH=%_CLASSPATH%
set _CLASSPATH=

*******************************************************************
build.xml
*******************************************************************
<project name="Hello, World" 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="myapp"/>
  <property name="deploy.home"   
value="${tomcat.home}/webapps/${app.name}"/>
  <property name="dist.home"      value="${deploy.home}"/>
  <property name="dist.src"       value="${app.name}/src"/>
  <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="compilenew" depends="prepare" init="init">
    <javac srcdir="src" destdir="src"
           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="." items="*"/>
    <jar jarfile="${dist.home}/${dist.war}"
         basedir="${deploy.home}" items="*"/>
  </target>


</project>

********************************************************************
Output from running:

build compile
********************************************************************

D:\jakarta-tomcat\doc\appdev\sample>build compile
ant classpath =
d:\jakarta-tomcat\classes;d:\jakarta-tomcat\lib\ant.jar;d:\jakarta-tomcat\lib\jasper
.jar;d:\jakarta-tomcat\lib\servlet.jar;d:\jakarta-tomcat\lib\webserver.jar;d:\jakarta-tomcat\lib\xml
.jar
Buildfile: build.xml
Setting project property: ant.java.version -> 1.3
Detected Java Version: 1.3
Detected OS: Windows NT
 +User task: expand     org.apache.tools.ant.taskdefs.Expand
 +User task: javac     org.apache.tools.ant.taskdefs.Javac
 +User task: keysubst     org.apache.tools.ant.taskdefs.KeySubst
 +User task: copyfile     org.apache.tools.ant.taskdefs.Copyfile
 +User task: gzip     org.apache.tools.ant.taskdefs.GZip
 +User task: javadoc     org.apache.tools.ant.taskdefs.Javadoc
 +User task: jar     org.apache.tools.ant.taskdefs.Jar
 +User task: property     org.apache.tools.ant.taskdefs.Property
 +User task: rename     org.apache.tools.ant.taskdefs.Rename
 +User task: filter     org.apache.tools.ant.taskdefs.Filter
 +User task: copydir     org.apache.tools.ant.taskdefs.Copydir
 +User task: cvs     org.apache.tools.ant.taskdefs.Cvs
 +User task: chmod     org.apache.tools.ant.taskdefs.Chmod
 +User task: java     org.apache.tools.ant.taskdefs.Java
 +User task: renameext    
org.apache.tools.ant.taskdefs.optional.RenameExtensions
 +User task: available     org.apache.tools.ant.taskdefs.Available
 +User task: deltree     org.apache.tools.ant.taskdefs.Deltree
 +User task: ant     org.apache.tools.ant.taskdefs.Ant
 +User task: netrexxc    
org.apache.tools.ant.taskdefs.optional.NetRexxC
 +User task: exec     org.apache.tools.ant.taskdefs.Exec
 +User task: fixcrlf     org.apache.tools.ant.taskdefs.FixCRLF
 +User task: taskdef     org.apache.tools.ant.taskdefs.Taskdef
 +User task: tar     org.apache.tools.ant.taskdefs.Tar
 +User task: mkdir     org.apache.tools.ant.taskdefs.Mkdir
 +User task: delete     org.apache.tools.ant.taskdefs.Delete
 +User task: zip     org.apache.tools.ant.taskdefs.Zip
 +User task: echo     org.apache.tools.ant.taskdefs.Echo
 +User task: tstamp     org.apache.tools.ant.taskdefs.Tstamp
 +User task: replace     org.apache.tools.ant.taskdefs.Replace
 +User task: get     org.apache.tools.ant.taskdefs.Get
 +User task: rmic     org.apache.tools.ant.taskdefs.Rmic
 +User task: javadoc2     org.apache.tools.ant.taskdefs.Javadoc
Setting project property: java.runtime.name -> Java(TM) 2 Runtime
Environment, Standard Edition
Setting project property: sun.boot.library.path -> d:\jdk1.3\jre\bin
Setting project property: java.vm.version -> 1.3.0-C
Setting project property: java.vm.vendor -> Sun Microsystems Inc.
Setting project property: java.vendor.url -> http://java.sun.com/
Setting project property: path.separator -> ;
Setting project property: java.vm.name -> Java HotSpot(TM) Client VM
Setting project property: file.encoding.pkg -> sun.io
Setting project property: java.vm.specification.name -> Java Virtual
Machine Specification
Setting project property: user.dir ->
D:\jakarta-tomcat\doc\appdev\sample
Setting project property: java.runtime.version -> 1.3.0-C
Setting project property: java.awt.graphicsenv ->
sun.awt.Win32GraphicsEnvironment
Setting project property: os.arch -> x86
Setting project property: java.io.tmpdir -> C:\TEMP\
Setting project property: line.separator ->

Setting project property: java.vm.specification.vendor -> Sun
Microsystems Inc.
Setting project property: java.awt.fonts ->
Setting project property: os.name -> Windows NT
Setting project property: java.library.path ->
d:\jdk1.3\bin;.;C:\WINNT\System32;C:\WINNT;d:\jakarta
-tomcat\bin;d:\jdk1.3\bin;PYTHON%;d:\cygnus\cygwin-b20\H-i586-cygwin32\bin;d:\Program
Files\Poet60\b
in;d:\Program Files\IBM\GSK\lib;C:\WINNT\system32;C:\WINNT;
Setting project property: java.specification.name -> Java Platform API
Specification
Setting project property: java.class.version -> 47.0
Setting project property: os.version -> 4.0
Setting project property: user.home -> C:\WINNT\Profiles\rick
Setting project property: user.timezone ->
Setting project property: java.awt.printerjob ->
sun.awt.windows.WPrinterJob
Setting project property: file.encoding -> Cp1252
Setting project property: java.specification.version -> 1.3
Setting project property: java.class.path ->
d:\jakarta-tomcat\classes;d:\jakarta-tomcat\lib\ant.jar
;d:\jakarta-tomcat\lib\jasper.jar;d:\jakarta-tomcat\lib\servlet.jar;d:\jakarta-tomcat\lib\webserver.
jar;d:\jakarta-tomcat\lib\xml.jar
Setting project property: user.name -> rick
Setting project property: java.vm.specification.version -> 1.0
Setting project property: java.home -> d:\jdk1.3\jre
Setting project property: user.language -> en
Setting project property: java.specification.vendor -> Sun Microsystems
Inc.
Setting project property: awt.toolkit -> sun.awt.windows.WToolkit
Setting project property: java.vm.info -> mixed mode
Setting project property: java.version -> 1.3.0
Setting project property: java.ext.dirs -> d:\jdk1.3\jre\lib\ext
Setting project property: sun.boot.class.path ->
d:\jdk1.3\jre\lib\rt.jar;d:\jdk1.3\jre\lib\i18n.jar
;d:\jdk1.3\jre\lib\sunrsasign.jar;d:\jdk1.3\jre\classes
Setting project property: java.vendor -> Sun Microsystems Inc.
Setting project property: file.separator -> \
Setting project property: java.vendor.url.bug ->
http://java.sun.com/cgi-bin/bugreport.cgi
Setting project property: sun.io.unicode.encoding -> UnicodeLittle
Setting project property: sun.cpu.endian -> little
Setting project property: user.region -> US
Setting project property: sun.cpu.isalist -> pentium_pro+mmx pentium_pro
pentium+mmx pentium i486 i3
86
Setting ro project property: tomcat.home -> d:\jakarta-tomcat
Setting ro project property: ant.file ->
D:\jakarta-tomcat\doc\appdev\sample\build.xml
Setting project property: basedir -> D:\jakarta-tomcat\doc\appdev\sample
Project base dir set to: D:\jakarta-tomcat\doc\appdev\sample
Setting project property: app.name -> myapp
Setting project property: deploy.home -> d:\jakarta-tomcat/webapps/myapp
Setting project property: dist.home -> d:\jakarta-tomcat/webapps/myapp
Setting project property: dist.src -> myapp/src
Setting project property: dist.war -> myapp.war
Setting project property: javadoc.home ->
d:\jakarta-tomcat/webapps/myapp/javadoc
 +Target: prepare
   +Task: mkdir
   +Task: copydir
   +Task: mkdir
   +Task: copyfile
   +Task: mkdir
   +Task: mkdir
   +Task: copydir
   +Task: mkdir
 +Target: clean
   +Task: deltree
 +Target: compile
   +Task: javac
 +Target: compilenew
   +Task: javac
 +Target: javadoc
 +Target: all
 +Target: dist
   +Task: jar
The items attribute is deprecated. Please use the includes attribute.
   +Task: jar
The items attribute is deprecated. Please use the includes attribute.
Build sequence for target `compile' is [prepare, compile]
Complete build sequence is [prepare, compile, javadoc, clean, all, dist,
compilenew]
Executing Target: prepare
Executing Target: compile
Compiling 1 source files to
D:\jakarta-tomcat\webapps\myapp\WEB-INF\classes
Performing a Modern Compile
Completed in 0 seconds

Mime
View raw message