maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Milliss <>
Subject maven antrun plugin issue with sending emails
Date Thu, 21 May 2009 22:53:13 GMT
I'm having problems getting the ant mail task working when running from 
the antrun plugin, the pom and ant build files I use to highlight this 
issue are below

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" 
                        <id>Test for email sending</id>
                                <ant antfile="${basedir}/build.xml" 
                          <target name="send-email-notification"/>

<?xml version="1.0"?>
<project name="mail-test">
        <target name="send-email-notification">
        <mail mailhost="" mailport="465" ssl="false" 
subject="testing 1 2 3">
            <from address="" />
            <to address="" />
            <message>This is a test email</message>

When I run
mvn compile
the following error occurs and no email is sent.

[INFO] Scanning for projects...
[INFO] Building mail-test
[INFO]    task-segment: [compile]
[INFO] [resources:resources]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered 
resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory 
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [antrun:run {execution: Test for email sending}]
[INFO] Executing tasks

     [mail] Failed to initialise MIME mail:
[INFO] Executed tasks
[INFO] Total time: 1 second
[INFO] Finished at: Fri May 22 08:44:45 EST 2009
[INFO] Final Memory: 8M/108M

If I run the ant script directly ie "ant send-email-notification" it 
works fine. I have the mail and activation jars in the ANT_HOME/lib 

My environement is:
mvn -v
Apache Maven 2.1.0 (r755702; 2009-03-19 06:10:27+1100)
Java version: 1.6.0_06
Java home: /usr/java/jdk1.6.0_06/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "" arch: "i386" Family: "unix"

ant -v
Apache Ant version 1.7.1 compiled on June 27 2008
Buildfile: build.xml
Detected Java version: 1.6 in: /usr/java/jdk1.6.0_06/jre
Detected OS: Linux
parsing buildfile /home/development/Desktop/build.xml with URI = 
Project base dir set to: /home/development/Desktop

Total time: 0 seconds

Any help would be greatly appreciated.

Matt Milliss

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

View raw message