ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r677516 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java
Date Thu, 17 Jul 2008 07:11:26 GMT
Author: bodewig
Date: Thu Jul 17 00:11:25 2008
New Revision: 677516

URL: http://svn.apache.org/viewvc?rev=677516&view=rev
Log:
Don't rely on Java verifier when checking for JavaMail in mail task.  PR 31969.  Submitted
by Kev Jackson.

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java?rev=677516&r1=677515&r2=677516&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java Thu Jul 17
00:11:25 2008
@@ -417,10 +417,16 @@
             if (encoding.equals(MIME)
                  || (encoding.equals(AUTO) && !autoFound)) {
                 try {
+                    //check to make sure that activation.jar 
+                    //and mail.jar are available - see bug 31969
+                    Class.forName("javax.activation.DataHandler");
+                    Class.forName("javax.mail.internet.MimeMessage");
+
                     mailer = (Mailer) ClasspathUtils.newInstance(
                             "org.apache.tools.ant.taskdefs.email.MimeMailer",
                             EmailTask.class.getClassLoader(), Mailer.class);
                     autoFound = true;
+
                     log("Using MIME mail", Project.MSG_VERBOSE);
                 } catch (BuildException e) {
                     logBuildException("Failed to initialise MIME mail: ", e);



Mime
View raw message