Bookmark Topic Watch Topic
  • New Topic

E-mail implementation through maven

 
mukesh pandey
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
I'm going to lock this duplicate, lets continue in the other thread!
 
    Bookmark Topic Watch Topic
  • New Topic