ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave <dwal...@users.sourceforge.net>
Subject Re: Help with JUNit task
Date Sat, 10 Mar 2001 15:02:48 GMT
Here is a bit more isolated case. Same error.

Interestingly, native2ascii is in the User task list, but junit is not. Is that the problem?

Thanks,

Dave


[dwalend@sneakyvine test]$ $ANT_HOME
bash: /usr/share/ant: is a directory
[dwalend@sneakyvine test]$ ls $ANT_HOME
bin  lib
[dwalend@sneakyvine test]$ ls /usr/share/ant/lib/
junit.jar  optional.jar

The whole build.xml file:

<project name="junit-test" default="test-dist" basedir=".">

 <!-- set global properties for this build -->

 <!-- where all the source code lives. Basically everything in the cvs repository except
build.xml -->
 <property name="src" value="source" />

 <!-- where all dependant generated code lives -->
 <property name="production" value="production" />

 <!-- where compiled code gets assembled -->
 <property name="build" value="${production}/build" />

 <!-- where jarfiles and tarballs get sorted into directories -->
 <property name="dist"  value="${production}/dist" />

<!-- where the .jar files go -->
 <property name="lib" value="${dist}/lib"/>

<!-- Classpaths -->

<!-- test class paths -->

 <property name="test-jar" value="${lib}/test.jar" />

 <property name="junit-jar" value="/usr/local/java/junit/junit.jar"/>

 <property name="optional-jar" value="/usr/share/java/optional.jar" />

<!-- clean up the build mess -->
 <target name="clean">
  <delete dir="${production}" />
 </target>


<!-- prepare the build tree to build anything -->
 <target name="prepare" depends="clean">
  <!-- Create the time stamp -->
  <tstamp/>
  <!-- Create the build directory structure used by compile -->
  <mkdir dir="${production}" />

  <mkdir dir="${build}" />
  <mkdir dir="${dist}" />
  <mkdir dir="${lib}" />

 </target>

<!-- build test.jar -->
 <target name="test-jar" depends="prepare">
  <mkdir dir="${build}/test" />
  <javac srcdir="${src}" includes="**" destdir="${build}/test" >
   <classpath>
    <pathelement path="${test-jar}" />
    <pathelement path="${junit-jar}" />
   </classpath>
  </javac>
  <jar jarfile="${lib}/test.jar" basedir="${build}/test" />
 </target>

<!-- test test.jar -->
 <target name="test" depends="test-jar">
  <echo message="${java.class.path}:${test-jar}:${junit-jar}" />

  <junit printsummary="yes" haltonfailure="yes" fork="yes" >
   <jvmarg value="-Djava.compiler=NONE"/>
    <formatter type="plain" usefile="no"/>
    <classpath>
     <pathelement path="${java.class.path}" />
     <pathelement path="${test-jar}" />
     <pathelement path="${junit-jar}" />
    </classpath>
   <test name="JUnitTest" />
  </junit>
 </target>

</project>
 ---------------------

output from ant -emacs -debug test:
cd ~/test/
ant -emacs -debug test
Ant version 1.3 compiled on March 5 2001

Buildfile: build.xml
Setting project property: ant.java.version -> 1.3
Detected Java Version: 1.3
Detected OS: Linux
 +User task: tar     org.apache.tools.ant.taskdefs.Tar
 +User task: fail     org.apache.tools.ant.taskdefs.Exit
 +User task: uptodate     org.apache.tools.ant.taskdefs.UpToDate
 +User task: java     org.apache.tools.ant.taskdefs.Java
 +User task: execon     org.apache.tools.ant.taskdefs.ExecuteOn
 +User task: echo     org.apache.tools.ant.taskdefs.Echo
 +User task: native2ascii     org.apache.tools.ant.taskdefs.optional.Native2Ascii
 +User task: jjtree     org.apache.tools.ant.taskdefs.optional.javacc.JJTree
 +User task: compileTask     org.apache.tools.ant.taskdefs.CompileTask
 +User task: chmod     org.apache.tools.ant.taskdefs.Chmod
 +User task: javadoc2     org.apache.tools.ant.taskdefs.Javadoc
 +User task: deltree     org.apache.tools.ant.taskdefs.Deltree
 +User task: cvs     org.apache.tools.ant.taskdefs.Cvs
 +User task: jlink     org.apache.tools.ant.taskdefs.optional.jlink.JlinkTask
 +User task: tstamp     org.apache.tools.ant.taskdefs.Tstamp
 +User task: unjar     org.apache.tools.ant.taskdefs.Expand
 +User task: patch     org.apache.tools.ant.taskdefs.Patch
 +User task: sound     org.apache.tools.ant.taskdefs.optional.sound.SoundTask
 +User task: cccheckout     org.apache.tools.ant.taskdefs.optional.clearcase.CCCheckout
 +User task: mail     org.apache.tools.ant.taskdefs.SendEmail
 +User task: gzip     org.apache.tools.ant.taskdefs.GZip
 +User task: copy     org.apache.tools.ant.taskdefs.Copy
 +User task: filter     org.apache.tools.ant.taskdefs.Filter
 +User task: jar     org.apache.tools.ant.taskdefs.Jar
 +User task: unzip     org.apache.tools.ant.taskdefs.Expand
 +User task: rename     org.apache.tools.ant.taskdefs.Rename
 +User task: propertyfile     org.apache.tools.ant.taskdefs.optional.PropertyFile
 +User task: copyfile     org.apache.tools.ant.taskdefs.Copyfile
 +User task: gunzip     org.apache.tools.ant.taskdefs.GUnzip
 +User task: antcall     org.apache.tools.ant.taskdefs.CallTarget
 +User task: taskdef     org.apache.tools.ant.taskdefs.Taskdef
 +User task: mkdir     org.apache.tools.ant.taskdefs.Mkdir
 +User task: sql     org.apache.tools.ant.taskdefs.SQLExec
 +User task: replace     org.apache.tools.ant.taskdefs.Replace
 +User task: ant     org.apache.tools.ant.taskdefs.Ant
 +User task: style     org.apache.tools.ant.taskdefs.XSLTProcess
 +User task: fixcrlf     org.apache.tools.ant.taskdefs.FixCRLF
 +User task: vssget     org.apache.tools.ant.taskdefs.optional.vss.MSVSSGET
 +User task: genkey     org.apache.tools.ant.taskdefs.GenerateKey
 +User task: zip     org.apache.tools.ant.taskdefs.Zip
 +User task: antstructure     org.apache.tools.ant.taskdefs.AntStructure
 +User task: javah     org.apache.tools.ant.taskdefs.optional.Javah
 +User task: javac     org.apache.tools.ant.taskdefs.Javac
 +User task: test     org.apache.tools.ant.taskdefs.optional.Test
 +User task: cab     org.apache.tools.ant.taskdefs.optional.Cab
 +User task: mparse     org.apache.tools.ant.taskdefs.optional.metamata.MParse
 +User task: ccuncheckout     org.apache.tools.ant.taskdefs.optional.clearcase.CCUnCheckout
 +User task: ejbjar     org.apache.tools.ant.taskdefs.optional.ejb.EjbJar
 +User task: available     org.apache.tools.ant.taskdefs.Available
 +User task: vsslabel     org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABEL
 +User task: wljspc     org.apache.tools.ant.taskdefs.optional.jsp.WLJspc
 +User task: move     org.apache.tools.ant.taskdefs.Move
 +User task: csc     org.apache.tools.ant.taskdefs.optional.dotnet.CSharp
 +User task: signjar     org.apache.tools.ant.taskdefs.SignJar
 +User task: javacc     org.apache.tools.ant.taskdefs.optional.javacc.JavaCC
 +User task: cccheckin     org.apache.tools.ant.taskdefs.optional.clearcase.CCCheckin
 +User task: property     org.apache.tools.ant.taskdefs.Property
 +User task: unwar     org.apache.tools.ant.taskdefs.Expand
 +User task: touch     org.apache.tools.ant.taskdefs.Touch
 +User task: ilasm     org.apache.tools.ant.taskdefs.optional.dotnet.Ilasm
 +User task: get     org.apache.tools.ant.taskdefs.Get
 +User task: javadoc     org.apache.tools.ant.taskdefs.Javadoc
 +User task: untar     org.apache.tools.ant.taskdefs.Untar
 +User task: delete     org.apache.tools.ant.taskdefs.Delete
 +User task: copydir     org.apache.tools.ant.taskdefs.Copydir
 +User task: war     org.apache.tools.ant.taskdefs.War
 +User task: ccupdate     org.apache.tools.ant.taskdefs.optional.clearcase.CCUpdate
 +User task: depend     org.apache.tools.ant.taskdefs.optional.depend.Depend
 +User task: renameext     org.apache.tools.ant.taskdefs.optional.RenameExtensions
 +User task: exec     org.apache.tools.ant.taskdefs.ExecTask
 +User task: apply     org.apache.tools.ant.taskdefs.Transform
 +User task: rmic     org.apache.tools.ant.taskdefs.Rmic
 +User datatype: fileset     org.apache.tools.ant.types.FileSet
 +User datatype: patternset     org.apache.tools.ant.types.PatternSet
 +User datatype: path     org.apache.tools.ant.types.Path
 +User datatype: mapper     org.apache.tools.ant.types.Mapper
Setting project property: java.runtime.name -> Java(TM) 2 Runtime Environment, Standard
Edition
Setting project property: sun.boot.library.path -> /usr/java/jdk1.3.1/jre/lib/i386
Setting project property: java.vm.version -> 1.3.1beta-b15
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 -> /home/dwalend/test
Setting project property: java.runtime.version -> 1.3.1-beta-b15
Setting project property: java.awt.graphicsenv -> sun.awt.X11GraphicsEnvironment
Setting project property: os.arch -> i386
Setting project property: java.io.tmpdir -> /tmp
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 -> Linux
Setting project property: ant.home -> /usr/share/ant
Setting project property: java.library.path -> /usr/java/jdk1.3.1/jre/lib/i386:/usr/java/jdk1.3.1/jre/lib/i386/native_threads/:/usr/java/jdk1.3.1/jre/lib/i386/client:/usr/java/jdk1.3.1/jre/../lib/i386:/usr/local/lib:/usr/local/glut/lib/glut:/usr/local/mesa/lib:/home/dwalend/weblogic-510/lib/linux
Setting project property: java.specification.name -> Java Platform API Specification
Setting project property: java.class.version -> 47.0
Setting project property: os.version -> 2.2.12-20
Setting project property: user.home -> /home/dwalend
Setting project property: user.timezone ->
Setting project property: java.awt.printerjob -> sun.awt.motif.PSPrinterJob
Setting project property: file.encoding -> ISO-8859-1
Setting project property: java.specification.version -> 1.3
Setting project property: java.class.path -> /usr/local/java/junit/junit.jar:/usr/share/ant/lib/optional.jar:/usr/share/java/ant.jar:/usr/share/java/jaxp.jar:/usr/share/java/parser.jar:/usr/java/jdk1.3.1/lib/tools.jar:/usr/java/jdk1.3.1/jre/lib/rt.jar:/usr/java/jdk1.3.1/jre/lib/rt.jar
Setting project property: user.name -> dwalend
Setting project property: java.vm.specification.version -> 1.0
Setting project property: java.home -> /usr/java/jdk1.3.1/jre
Setting project property: user.language -> en
Setting project property: java.specification.vendor -> Sun Microsystems Inc.
Setting project property: java.vm.info -> mixed mode
Setting project property: java.version -> 1.3.1-beta
Setting project property: java.ext.dirs -> /usr/java/jdk1.3.1/jre/lib/ext
Setting project property: sun.boot.class.path -> /usr/java/jdk1.3.1/jre/lib/rt.jar:/usr/java/jdk1.3.1/jre/lib/i18n.jar:/usr/java/jdk1.3.1/jre/lib/sunrsasign.jar:/usr/java/jdk1.3.1/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 ->
Setting ro project property: ant.file -> /home/dwalend/test/build.xml
parsing buildfile /home/dwalend/test/build.xml with URI = file:/home/dwalend/test/build.xml
Setting ro project property: ant.project.name -> junit-test
Setting project property: basedir -> /home/dwalend/test
Project base dir set to: /home/dwalend/test
   +Task: property
Setting project property: src -> source
   +Task: property
Setting project property: production -> production
   +Task: property
Setting project property: build -> production/build
   +Task: property
Setting project property: dist -> production/dist
   +Task: property
Setting project property: lib -> production/dist/lib
   +Task: property
Setting project property: test-jar -> production/dist/lib/test.jar
   +Task: property
Setting project property: junit-jar -> /usr/local/java/junit/junit.jar
   +Task: property
Setting project property: optional-jar -> /usr/share/java/optional.jar
 +Target: clean
   +Task: delete
 +Target: prepare
   +Task: tstamp
   +Task: mkdir
   +Task: mkdir
   +Task: mkdir
   +Task: mkdir
 +Target: test-jar
   +Task: mkdir
   +Task: javac
   +Task: jar
 +Target: test
   +Task: echo
Build sequence for target `test' is [clean, prepare, test-jar, test]
Complete build sequence is [clean, prepare, test-jar, test]

clean:
Deleting directory /home/dwalend/test/production
Deleting /home/dwalend/test/production/build/test/JUnitTest.class
Deleting /home/dwalend/test/production/build/test/JUnitVictem.class
Deleting directory /home/dwalend/test/production/build/test
Deleting directory /home/dwalend/test/production/build
Deleting /home/dwalend/test/production/dist/lib/test.jar
Deleting directory /home/dwalend/test/production/dist/lib
Deleting directory /home/dwalend/test/production/dist
Deleting directory /home/dwalend/test/production

prepare:
Setting project property: DSTAMP -> 20010310
Setting project property: TSTAMP -> 0953
Setting project property: TODAY -> March 10 2001
Created dir: /home/dwalend/test/production
Created dir: /home/dwalend/test/production/build
Created dir: /home/dwalend/test/production/dist
Created dir: /home/dwalend/test/production/dist/lib

test-jar:
Created dir: /home/dwalend/test/production/build/test
JUnitTest.java added as /home/dwalend/test/production/build/test/JUnitTest.class doesn't exist.
JUnitVictem.java added as /home/dwalend/test/production/build/test/JUnitVictem.class doesn't
exist.
Compiling 2 source files to /home/dwalend/test/production/build/test
Using modern compiler
Compilation args: -d /home/dwalend/test/production/build/test -classpath /home/dwalend/test/production/build/test:/usr/local/java/junit3.5/junit.jar:/usr/share/java/optional.jar:/usr/share/java/ant.jar:/usr/share/java/jaxp.jar:/usr/share/java/parser.jar:/usr/java/jdk1.3.1/lib/tools.jar:/usr/java/jdk1.3.1/jre/lib/rt.jar
-sourcepath /home/dwalend/test/source
Files to be compiled:
    /home/dwalend/test/source/JUnitTest.java
    /home/dwalend/test/source/JUnitVictem.java

Building jar: /home/dwalend/test/production/dist/lib/test.jar

test:
/usr/local/java/junit/junit.jar:/usr/share/ant/lib/optional.jar:/usr/share/java/ant.jar:/usr/share/java/jaxp.jar:/usr/share/java/parser.jar:/usr/java/jdk1.3.1/lib/tools.jar:/usr/java/jdk1.3.1/jre/lib/rt.jar:/usr/java/jdk1.3.1/jre/lib/rt.jar:production/dist/lib/test.jar:/usr/local/java/junit/junit.jar
Could not create task of type: junit Common solutions are adding the task to defaults.properties
and executing bin/bootstrap

BUILD FAILED

/home/dwalend/test/build.xml:65: Could not create task of type: junit. Common solutions are
to use taskdef to declare your task, or, if this is an optional task, to put the optional.jar
in the lib directory of your ant installation (ANT_HOME).

Total time: 6 seconds

Compilation exited abnormally with code 1 at Sat Mar 10 09:53:56





Mime
View raw message