ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <>
Subject Re: Classloader problems
Date Fri, 08 Jun 2007 08:58:29 GMT
On 6/8/07, Kevin Jackson <> wrote:
> Hi,
> > I was supprised that the <taskdef> you described
> > worked for scp, I think that you have removed the
> > ant-jsch.jar from from $ANT_HOME/lib.
> Yes as the classloader will find the ant-jsch.jar iin $ANT_HOME/lib
> and try to load the jsch code from there.  I moved it to a different
> location and <csp> worked fine - I expected the same behaviour with
> <mail>, but instead I've had some problems.
<looking at the code and the ant 1.7.0 jars files>
The ant-email.jar file does not contain the mail task. <mail> is
not an "optional" task. and is located in ant.jar, however if mime
types are used, the EmailTask code will attempt to load MimeMailer
(which is in ant-email.jar) by doing the following:
         mailer = (Mailer) ClasspathUtils.newInstance(
                            EmailTask.class.getClassLoader(), Mailer.class);

Which seems a bit pointless from a deployment point of view, but it
does allow the EmailTask to get compiled without depending on
javamail.jar in the classpath.

This means that the moving ant-email.jar from $ANT_HOME/lib will
not work.

The EmailTask code could be modified to allow a classpath element to be used
to load the MimeMailer class (with junittask like classloader tricks),
but in the meantime,
one  can use the cl:classloader task.


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

View raw message