ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Jackson" <>
Subject Classloader problems
Date Thu, 07 Jun 2007 06:15:55 GMT
Hi all,

For obscure reasons, I have to redefine the core email task using a taskdef.
This is my build file:
<path id="jsch.path">
  <pathelement location="${}/jsch/ant-jsch.jar"/>
  <pathelement location="${}/jsch/jsch-0.1.33.jar"/>
<taskdef name="scp"

<taskdef name="sshexec"
<taskdef name="mail"
	  <pathelement location="${}/mail/ant-javamail.jar"/>
	  <pathelement location="${}/mail/mail.jar"/>

Now the strange thing is that thescp & sshexec tasks report that they
have been over-ridden by the new definitions, and with -debug enabled
I can see the correct classes being loaded.  The mail task however
just reports ' Class
loaded from parent loader (parentFirst)'.

Then finally it fails with ClassNotFoundException.  This means that
the <classpath> is ignored for the mail taskkdef, but is used
correctly for the scp/sshexec taskdefs.

I would think it would make sense to treat all taskdefs & classpaths equal...

I cannot copy the jars into ~/.ant/lib, or $ANT_HOME/lib, and I cannot
rely on a CLASSPATH variable or an external calling script.  The only
way I can make what I want to do work is via the taskdefs which honour
the <classpath> or classpathref.  Does anyone know how to work around


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

View raw message