GeeCON Prague 2014*
The moose likes Ant, Maven and Other Build Tools and the fly likes E-mail implementation through maven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply locked New topic
Author

E-mail implementation through maven

mukesh pandey
Greenhorn

Joined: Apr 02, 2010
Posts: 22
Hi All,

I want to send am email with attachement when my pom.xml runs so can anyone tell me how I can implement email program in maven. though using ant task I know.
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1282

Hi mukesh,

what exactly do you mean with "when my pom.xml runs". The POM is a declarative project description. It doesn't "run" like Ant scripts which are "coded" in XML.

Do you need some reporting? Maybe a continous integration server like Hudson does what you rellay need?!? Alternatively there's an Antrun plugin for Maven which allows you to execute Ant task from inside a Maven project. But without having more information it's hard to tell what you need. Perhaps you can elaborate a little bit more on this.

Marco
mukesh pandey
Greenhorn

Joined: Apr 02, 2010
Posts: 22
I am using a mail sending ant task in maven i m providing required jar as dependencies but I am getting below error

[mail] Failed to initialise MIME mail: Class org.apache.tools.ant.util.ClasspathUtils can not access a member of class org.apache.tools.ant.taskdefs.email.MimeMailer with modifiers ""

my ant task is :

<mail mailhost="smtpname" mailport="25" subject="GH-Test Report">
<from address="GH-Hudson" />
<to address="somemailid" />
<message>Please find the GH test reports attached</message>
<fileset dir="C:/myfiles">
<include name="index.html" />
</fileset>
</mail>



while I can run above task in ant seperately without any problem but when I add this task with maven I get the error:
[mail] Failed to initialise MIME mail: Class org.apache.tools.ant.util.ClasspathUtils can not access a member of class org.apache.tools.ant.taskdefs.email.MimeMailer with modifiers ""
mukesh pandey
Greenhorn

Joined: Apr 02, 2010
Posts: 22
when I unjar the ant.jar I did not find the MimeMailer class in that. is that the reason ? how can i het the jar which has MimeMailer
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

I'm going to lock this duplicate, lets continue in the other thread!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
GeeCON Prague 2014
 
subject: E-mail implementation through maven