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 "com.sun.tools.xjc.XJCTask".  Below that, there is
> a target that references the "xjc2" task.

> The taskdef looks like this:

>       <taskdef name="xjc2" classname="com.sun.tools.xjc.XJCTask">
>               <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 com.sun.tools.xjc.XJCTask 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
difference.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to