I'm writing, among other things, an ant taskdef.  It's part of a 
project that I'm building with Maven.  I'd like to unittest the taskdef 
by generating a buildfile that refers to the taskdef and "building" it 
using ant.

I figured that since Maven is managing all the classpath issues for me 
(and needs ant itself), I could just do something like this inside my 
test method:

    org.apache.tools.ant.Main.start(new String[] { "-buildfile",
                                                   "/buildfile.xml" },
                                    null,
                                    MyTestCase.class.getClassLoader());

...but while this does launch ant and does find the buildfile and does 
start building it, it can't find my taskdef (even though my taskdef is 
in the same package as my test case).  Or, to put it another way, ant 
runs fine, but when it sees:

    <taskdef name="mytask" classname="com.foo.BarTaskDef"/>

...it can't load com.foo.BarTaskDef even though the class making all of 
this happen is in the com.foo package and therefore visible to *some* 
classloader.

Is there something I need to do to, e.g. forehead.conf, or some other 
pattern I should be following?

Best,
Laird


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to