Missing ant -javamail.jar file on Macintosh

I ran the built-in Ant from the command line on a Macintosh (10.5.5) and ran some problems with the Mail task. Running the Mail task triggers the following message:

[mail] Failed to initialise MIME mail: org.apache.tools.ant.taskdefs.email.MimeMailer 

This is most likely due to the absence of the ant -javamail.jar file in the / usr / share / ant / lib directory. I see the ant-javamail-1.7.0.pom file in this directory, but not the corresponding jar file. Does anyone know why this jar file might be missing, and what is the best way to solve the problem?

+4
source share
3 answers

Here is what I did to solve the problem:

  • Download the latest version of Ant from http://ant.apache.org/
  • "built-in" Ant is installed in / usr / share / ant; I did not want to overwrite this version, so I extracted the new full version in / usr / local /share/apache-ant-1.7.1/
  • As npellow points out , Mac does not include mail.jar or activation.jar - these files can be downloaded and extracted from the JavaMail and JavaBeans Activation Framework APIs, respectively, and copied to the new Ant lib folder (the same folder as all ant - *. Jar files )
  • The Ant command (/ usr / bin / ant) ​​is a symbolic link to / usr / share / ant / bin / ant; I updated this link to point to the new version ( ln -s /usr/local/share/apache-ant-1.7.1/bin/ant /usr/bin/ant )

If for some reason you need to reinstall the old version of Ant by default again, just use ln -s /usr/share/ant/bin/ant /usr/bin/ant

Steps 2-4 were run on the command line as root. What it is - The Mac now has the latest, full version of Ant, and the Mail task works just fine.

+2
source

Download the Java Mail libraries from: http://java.sun.com/products/javamail/ . You will also need http://java.sun.com/products/javabeans/glasgow/jaf.html

The following is a list of all the external dependencies required by Ant for additional tasks http://ant.apache.org/manual/index.html .

Another way to get dependencies for Ant is very easy: run

 ant -f fetch all 

from $ ANT_HOME. You can also run -projecthelp for a complete list of goals:

 all load all the libraries antlr load antlr libraries bcel load bcel libraries beanshell load beanshell support bsf load bsf libraries debugging internal ant debugging get-m2 Download the Maven2 Ant tasks jdepend load jdepend libraries jruby load jruby junit load junit libraries jython load jython logging load logging libraries networking load networking libraries (commons-net; jsch) regexp load regexp libraries rhino load rhino script load script languages xerces load an updated version of Xerces xml load full XML libraries (xalan, resolver) 
+1
source

I also got this work a little differently:

This solves the problem for only one user account, but it was good for my purposes and saved me from having to have two separate Ant installations on my machine.

0
source

All Articles