ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Martin <antu...@gmail.com>
Subject Mail task with mail.jar & activation.jar out of lib folder
Date Wed, 19 Jan 2011 09:31:51 GMT
Hello,

Is it possible to use the <mail> task without having activation.jar
and mail.jar in the ant lib folder?

I tried to redefine the mail task this way:

<taskdef name="mymail"
classname="org.apache.tools.ant.taskdefs.email.MimeMailer">
	<classpath>
		<pathelement location="${ant.home}/lib/ant-javamail.jar" /> <!--
same with and without this line -->
		<pathelement location="a/mail.jar" />
		<pathelement location="a/activation.jar" />
	</classpath>
</taskdef>

But it did not work. I keep on getting the following error:

D:\tmp\build.xml:7: taskdef A class needed by class
org.apache.tools.ant.taskdefs.email.MimeMailer cannot be found:
javax/mail/MessagingException
 using the classloader AntClassLoader[D:\tmp\a\activation.jar]
        at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:627)
        at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:239)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:809)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.NoClassDefFoundError: javax/mail/MessagingException
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:242)
        at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:594)
        ... 18 more

I am using ant 1.8.2.

Thanks,

Patrick

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


Mime
View raw message