ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BOUSQUET Jeremie" <Jeremie.BOUSQ...@gemplus.com>
Subject [ANT 1.6.5] junitreport task using taskdef
Date Mon, 08 Aug 2005 14:56:47 GMT
Hello,

Following this article:
http://ant.apache.org/faq.html#delegating-classloader-1.6

... I removed ant-junit.jar from ANT_HOME/lib, and taskdefed junit task as follow, which worked
very well :
        <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
            <classpath>
                <pathelement location="${myrepository}\ext\apache\ant\1.6.5\ant-junit.jar"/>
                <pathelement location="${myrepository}\ext\junit\junit\3.8.1\junit.jar"/>
            </classpath>
        </taskdef>

By the way I'm using junitreport task which needs ant-junit.jar as well, so I had to taskdef
it also this way :
        <taskdef name="junitreport" classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
            <classpath>
                <pathelement location="${myrepository}\ext\apache\ant\1.6.5\ant-junit.jar"/>
                <pathelement location="${myrepository}\ext\junit\junit\3.8.1\junit.jar"/>
            </classpath>
        </taskdef>

... but this does not work. 
I get following error when executing junitreport:
java.lang.NoClassDefFoundError: org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor
        at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:539)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:384)
        at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

This class in my opinion is from ant-junit.jar, so I don't understand why it can find ant-junit.jar,
junit.jar (because junit task works), and why for junitreport it can't find a class in ant-junit.jar
...
I thought maybe it was looking for xalan stuff, and reported error only on XalanExecutor class
if this is dynamic class loading, so I added all xalan-j_2_7_0 stuff (serializer.jar, xalan.jar,
xml-apis.jar, xercesImpl.jar) in my taskdef but it didn't work better ...

I searched bugzilla and archived user list before posting (maybe badly ? Hope not ;) ).

Any help is welcome,

Thanks,

Jérémie Bousquet
-----------------------------


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message