ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Possible reasons for failing to find XJC task class
Date Tue, 11 Oct 2011 15:01:32 GMT
On 2011-10-10, KARR, DAVID wrote:

> I work with two groups who are both importing a build script written
> by our team.  The imported build script has a "taskdef" to define the
> "xjc2" task, using "".  Below that, there is
> a target that references the "xjc2" task.

> The taskdef looks like this:

> 	<taskdef name="xjc2" classname="">
> 		<classpath>
> 			<fileset dir="${basedir}/libtest" includes="*.jar" />
> 		</classpath>
> 	</taskdef>

> The "basedir" property is set to ".".  the "libtest" directory has
> "jaxb-xjc.jar", which has the XJCTask class.

${basedir} is the one of the importing build file, but you knew that.

> There are two builds that both import this build script.  One is using
> JDK 1.5.  The other is using JDK 1.6.  The former is working fine.
> The latter is failing with:

>     "taskdef class cannot be found"

Does the former break if you use JDK 1.6 to run the same build file?

Is it really not finding the XJCTask class or maybe rather one XJCTask
depends on?  JAXB is part of JDK 1.6 but not 1.5 - maybe you get into
some classloader conflicts WRT where certain JAXB classes get loaded
from.  I think XJC is even part of JDK 1.6, isn't it?

> I'm somewhat concerned that the taskdef is defined at the global level
> of the build script, as opposed to within the referencing target or a
> dependent target, but I don't know if it matters.

It shouldn't.

> Both builds are using Ant 1.7.0.

That's pretty old, but I don't think a newer version would make any


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message