ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: ant & junit works on win98, fails on deadrat 6.2
Date Tue, 29 Jan 2002 13:33:55 GMT
Is there some reason you need junit.jar in /usr/java? Have you tried
putting it in $ANT_HOME/lib instead (which would also be more portable
across your Win* and *nix boxes)? You wouldn't need to include it in the
<classpath> if it was in $ANT_HOME/lib, and it should all work as expected
(not sure why it doesn't when it's in some other dir, since I wasn't able
to get it to, either -- but it does work if it's in $ANT_HOME/lib).

Diane

--- Ray Tayek <rtayek@mediaone.net> wrote:
> At 03:57 PM 1/28/02 +0100, you wrote:
> >...
> >you don't tell Ant where to find junit.
> >
> >Add it to the classpath as well (and come back when you set fork to
> >false, as it won't work any longer after that ...)
> 
> i cleaned up the script and added junit.jar to the classpath as you 
> suggested. i still get a build failed. the same file works on windoze
> (with 
> the actual path changed to "d:/..."). and even more strangely, it works
> on 
> windoze with that line commented out!. iirc, there was a recent post
> about 
> this from KBaltz@responsenetworks.com entitled "JUnit adding jars to 
> classpath behind my back".
> 
> running with debug shows the compile step working ok, but the test step 
> gets a: "[junit] Could not create task of type:  junit Common solutions
> are 
> adding the task to the defaullts.properties and executing
> /bin/bootstrap." 
> before the build failed.
> 
> thanks
> 
> Script started on Mon Jan 28 23:23:50 2002
> .bashrc
> [ray@k6 junit]$ cat build.xml
> <project name="MyProject" default="dist" basedir=".">
>    <property name="src" value="."/>
>    <property name="build" value="build"/>
>    <property name="dist"  value="dist"/>
>    <property name="test"  value="test"/>
>    <target name="init">
>      <tstamp/> <mkdir dir="${build}"/>
>    </target>
>    <target name="compile" depends="init">
>      <echo message="src = ${src}"/>
>      <javac srcdir="${src}" destdir="${build}">
>      <classpath>
>        <pathelement location="/usr/java/junit.jar"/>
>      </classpath>
>      </javac>
>    </target>
>    <target name="test" depends="compile">
>      <junit fork="yes" printsummary="on"  haltonfailure="true">
>        <classpath>
>          <pathelement location="/usr/java/junit.jar"/>
>          <pathelement path="."/>
>        </classpath>
>        <test name="MainTest"/>
>        <formatter type="brief" usefile="false"/>
>      </junit>
>    </target>
>    <target name="dist" depends="test">
>      <mkdir dir="${dist}/lib"/>
>      <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar"
> basedir="${build}"/>
>    </target>
>    <target name="clean">
>      <delete dir="${build}"/>
>      <delete dir="${dist}"/>
>    </target>
> </project>
> [ray@k6 junit]$ ant -debug
> Ant version 1.4.1 compiled on January 27 2002
> Buildfile: build.xml
> Setting project property: ant.java.version -> 1.4
> Detected Java version: 1.4 in: /usr/local/src/java/j2sdk1.4.0/jre
> 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: dependset     org.apache.tools.ant.taskdefs.DependSet
>   +User task: 
> vsscheckin     org.apache.tools.ant.taskdefs.optional.vss.MSVSSCHECKIN
>   +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: 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: 
> ccmcreatetask    
> org.apache.tools.ant.taskdefs.optional.ccm.CCMCreateTask
>   +User task: jlink    
> org.apache.tools.ant.taskdefs.optional.jlink.JlinkTask
>   +User task: tstamp     org.apache.tools.ant.taskdefs.Tstamp
>   +User task: pathconvert     org.apache.tools.ant.taskdefs.PathConvert
>   +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: 
> mmetrics     org.apache.tools.ant.taskdefs.optional.metamata.MMetrics
>   +User task: 
> propertyfile     org.apache.tools.ant.taskdefs.optional.PropertyFile
>   +User task: copyfile     org.apache.tools.ant.taskdefs.Copyfile
>   +User task: 
> ccmcheckintask    
> org.apache.tools.ant.taskdefs.optional.ccm.CCMCheckinDefault
>   +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: ear     org.apache.tools.ant.taskdefs.Ear
>   +User task: ant     org.apache.tools.ant.taskdefs.Ant
>   +User task: 
> vsshistory     org.apache.tools.ant.taskdefs.optional.vss.MSVSSHISTORY
>   +User task: style     org.apache.tools.ant.taskdefs.XSLTProcess
>   +User task: fixcrlf     org.apache.tools.ant.taskdefs.FixCRLF
>   +User task: sequential     org.apache.tools.ant.taskdefs.Sequential
>   +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: condition     org.apache.tools.ant.taskdefs.ConditionTask
>   +User task: antstructure    
> org.apache.tools.ant.taskdefs.AntStructure
>   +User task: pvcs     org.apache.tools.ant.taskdefs.optional.pvcs.Pvcs
>   +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: 
> xmlvalidate     org.apache.tools.ant.taskdefs.optional.XMLValidateTask
>   +User task: 
> ccmreconfigure    
> org.apache.tools.ant.taskdefs.optional.ccm.CCMReconfigure
>   +User task: cab     org.apache.tools.ant.taskdefs.optional.Cab
>   +User task: typedef     org.apache.tools.ant.taskdefs.Typedef
>   +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: rpm     org.apache.tools.ant.taskdefs.optional.Rpm
>   +User task: 
> vsslabel     org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABEL
>   +User task: cvspass     org.apache.tools.ant.taskdefs.CVSPass
>   +User task: move     org.apache.tools.ant.taskdefs.Move
>   +User task: wljspc    
> org.apache.tools.ant.taskdefs.optional.jsp.WLJspc
>   +User task: javacc    
> org.apache.tools.ant.taskdefs.optional.javacc.JavaCC
>   +User task: signjar     org.apache.tools.ant.taskdefs.SignJar
>   +User task: csc    
> org.apache.tools.ant.taskdefs.optional.dotnet.CSharp
>   +User task: 
> cccheckin     org.apache.tools.ant.taskdefs.optional.clearcase.CCCheckin
>   +User task: property     org.apache.tools.ant.taskdefs.Property
>   +User task: 
> iplanet-ejbc    
> org.apache.tools.ant.taskdefs.optional.ejb.IPlanetEjbcTask
>   +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: 
> ccmcheckin     org.apache.tools.ant.taskdefs.optional.ccm.CCMCheckin
>   +User task: get     org.apache.tools.ant.taskdefs.Get
>   +User task: 
> blgenclient 
> org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient
>   +User task: 
> vsscheckout     org.apache.tools.ant.taskdefs.optional.vss.MSVSSCHECKOUT
>   +User task: javadoc     org.apache.tools.ant.taskdefs.Javadoc
>   +User task: record     org.apache.tools.ant.taskdefs.Recorder
>   +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: parallel     org.apache.tools.ant.taskdefs.Parallel
>   +User task: 
> ccmcheckout     org.apache.tools.ant.taskdefs.optional.ccm.CCMCheckout
>   +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: sleep     org.apache.tools.ant.taskdefs.Sleep
>   +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: filterset     org.apache.tools.ant.types.FilterSet
>   +User datatype: filelist     org.apache.tools.ant.types.FileList
>   +User datatype: description     org.apache.tools.ant.types.Description
>   +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/local/src/java/j2sdk1.4.0/jre/lib/i386
> Setting project property: java.vm.version -> 1.4.0-rc-b91
> 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: user.country -> US
> Setting project property: sun.os.patch.level -> unknown
> Setting project property: java.vm.specification.name -> Java Virtual 
> Machine Specification
> Setting project property: user.dir -> /home/ray/junit
> Setting project property: java.runtime.version -> 1.4.0-rc-b91
> Setting project property: java.awt.graphicsenv -> 
> sun.awt.X11GraphicsEnvironment
> Setting project property: java.endorsed.dirs -> 
> /usr/local/src/java/j2sdk1.4.0/jre/lib/endorsed
> 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: os.name -> Linux
> Setting project property: ant.home -> /usr/ant
> Setting project property: sun.java2d.fontpath ->
> Setting project property: java.library.path -> 
>
/usr/local/src/java/j2sdk1.4.0/jre/lib/i386/client:/usr/local/src/java/j2sdk1.4.0/jre/lib/i386:/usr/local/src/java/j2sdk1.4.0/jre/../lib/i386
> Setting project property: java.specification.name -> Java Platform API 
> Specification
> Setting project property: java.class.version -> 48.0
> Setting project property: java.util.prefs.PreferencesFactory -> 
> java.util.prefs.FileSystemPreferencesFactory
> Setting project property: os.version -> 2.2.14-5.0
> Setting project property: user.home -> /home/ray
> Setting project property: user.timezone ->
> Setting project property: java.awt.printerjob -> sun.print.PSPrinterJob
> Setting project property: file.encoding -> ISO-8859-1
> Setting project property: java.specification.version -> 1.4
> Setting project property: java.class.path -> 
> /usr/ant/lib/optional.jar:/usr/ant/lib/ant.jar:/usr/jdk/lib/tools.jar
> Setting project property: user.name -> ray
> Setting project property: java.vm.specification.version -> 1.0
> Setting project property: java.home ->
> /usr/local/src/java/j2sdk1.4.0/jre
> Setting project property: sun.arch.data.model -> 32
> 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.4.0-rc
> Setting project property: java.ext.dirs -> 
> /usr/local/src/java/j2sdk1.4.0/jre/lib/ext
> Setting project property: sun.boot.class.path -> 
>
/usr/local/src/java/j2sdk1.4.0/jre/lib/rt.jar:/usr/local/src/java/j2sdk1.4.0/jre/lib/i18n.jar:/usr/local/src/java/j2sdk1.4.0/jre/lib/sunrsasign.jar:/usr/local/src/java/j2sdk1.4.0/jre/lib/jsse.jar:/usr/local/src/java/j2sdk1.4.0/jre/lib/jce.jar:/usr/local/src/java/j2sdk1.4.0/jre/lib/charsets.jar:/usr/local/src/java/j2sdk1.4.0/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: sun.cpu.isalist ->
> Setting ro project property: ant.version -> Ant version 1.4.1 compiled
> on 
> January 27 2002
> Setting ro project property: ant.file -> /home/ray/junit/build.xml
> parsing buildfile /home/ray/junit/build.xml with URI = 
> file:/home/ray/junit/build.xml
> Setting ro project property: ant.project.name -> MyProject
> Adding reference: MyProject -> org.apache.tools.ant.Project@ab853b
> Setting project property: basedir -> /home/ray/junit
> Project base dir set to: /home/ray/junit
>    +Task: property
> Setting project property: src -> .
>     +Task: property
> Setting project property: build -> build
>     +Task: property
> Setting project property: dist -> dist
>     +Task: property
> Setting project property: test -> test
>   +Target: init
>     +Task: tstamp
>     +Task: mkdir
>   +Target: compile
>     +Task: echo
>     +Task: javac
>   +Target: test
>   +Target: dist
>     +Task: mkdir
>     +Task: jar
>   +Target: clean
>     +Task: delete
>     +Task: delete
> Build sequence for target `dist' is [init, compile, test, dist]
> Complete build sequence is [init, compile, test, dist, clean]
> 
> init:
> Setting project property: DSTAMP -> 20020128
> Setting project property: TSTAMP -> 2324
> Setting project property: TODAY -> January 28 2002
> 
> compile:
> 
>       [echo] src = .
> FileSet: Setup file scanner in dir /home/ray/junit with patternSet{ 
> includes: [] excludes: [] }
>      [javac] build.xml skipped - don't know how to handle it
>      [javac] Main.java omitted as /home/ray/junit/build/Main.class is up
> to 
> date.
>      [javac] MainTest.java omitted as
> /home/ray/junit/build/MainTest.class 
> is up to date.
>      [javac] typescript skipped - don't know how to handle it
>      [javac] build/Main.class skipped - don't know how to handle it
>      [javac] build/MainTest.class skipped - don't know how to handle it
>      [javac] bug skipped - don't know how to handle it
>      [javac] build.xml.old skipped - don't know how to handle it
> 
> test:
>      [junit] Could not create task of type: junit Common solutions are 
> adding the task to defaults.properties and executing bin/bootstrap
> 
> 
> BUILD FAILED
> 
> /home/ray/junit/build.xml:18: 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).
>          at 
> org.apache.tools.ant.UnknownElement.makeTask(UnknownElement.java:153)
>          at 
>
org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:83)
>          at org.apache.tools.ant.Task.perform(Task.java:216)
>          at org.apache.tools.ant.Target.execute(Target.java:184)
>          at org.apache.tools.ant.Target.performTasks(Target.java:202)
>          at org.apache.tools.ant.Project.executeTarget(Project.java:601)
>          at
> org.apache.tools.ant.Project.executeTargets(Project.java:560)
>          at org.apache.tools.ant.Main.runBuild(Main.java:454)
>          at org.apache.tools.ant.Main.start(Main.java:153)
>          at org.apache.tools.ant.Main.main(Main.java:176)
> 
> Total time: 4 seconds
> 
> [ray@k6 junit]$
> Script done on Mon Jan 28 23:24:27 2002
> 
> thanks
> 
> ---
> ray tayek http://home.earthlink.net/~rtayek/
> actively seeking telecommuting work
> orange county java users group http://www.ocjug.org/
> hate spam? http://samspade.org/ssw/
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:ant-user-help@jakarta.apache.org>
> 


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message