aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes how do i send a email test report from 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
Bookmark "how do i send a email test report from maven " Watch "how do i send a email test report from maven " New topic
Author

how do i send a email test report from maven

linda russel
Ranch Hand

Joined: Jan 05, 2012
Posts: 86
Any idea of which plugin to use in pom.xml and other changes required for it?
linda russel
Ranch Hand

Joined: Jan 05, 2012
Posts: 86




this is my pom.xml file
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5830
    
    7

This should help: http://doc.fortysix.ch/maven/maven-postman-plugin/surefire-mail-mojo.html


JBoss In Action
linda russel
Ranch Hand

Joined: Jan 05, 2012
Posts: 86
is there anything else i should do in order to get the email other than adding the above mentioned postman plugin to my pom.xml


linda russel
Ranch Hand

Joined: Jan 05, 2012
Posts: 86



why am not recieving any emails??
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5830
    
    7

Your configuration seems correct (at least according to http://support.google.com/mail/bin/answer.py?hl=en&answer=13287)

Does running with -X provide any clues? Have you tried the same settings in another app?

As an aside, I wouldn't send email from Maven itself. I'd have Jenkins fire off the build and send an email after it was completed. That way only official builds would result in email notifications. Or just let interested parties subscribe to the RSS feed for the job in Jenkins. Or they could subscribe to the RSS feeds in Nexus (which is where we deploy our artifacts).
linda russel
Ranch Hand

Joined: Jan 05, 2012
Posts: 86
I ran mvn test command from the command line.

one more thing is that i am still not sure that from which location the Test reports will be fetched if at all it is fetched in the first place!!!

Do i need to run any other command in order to get the email of test reports.

is the port number correct for the emai??
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1022
    
    5

Linda

You have defined your plugin to run under the 'deploy' phase. However, you are only running up to 'test' so no attempt to send the email is made.

Try mvn clean deploy instead.
linda russel
Ranch Hand

Joined: Jan 05, 2012
Posts: 86



i changed the phase to site and it downloaded some required plugins but i get the error as above
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5830
    
    7

Did you try running with -X to see if that provides additional details on the error. Looks like there is something wrong with the configuration.
linda russel
Ranch Hand

Joined: Jan 05, 2012
Posts: 86
is it like mvn -X site from command line?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5830
    
    7

Not "mvn -X site", rather "mvn -X deploy" because you have email configured to run during deploy.
linda russel
Ranch Hand

Joined: Jan 05, 2012
Posts: 86
Thanks for your reply.

I will surely test with the above command
linda russel
Ranch Hand

Joined: Jan 05, 2012
Posts: 86
Finally i got a email but i got it only when i used GMAIL . but when i tried with my company email it failed.


I tried to ping smtp.mycompany.com but i got the error as below



Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5830
    
    7

You will have to contact your IT department to find out the proper settings for connecting to the corporate email system. I have the same issue with the Exchange server in my company - I cannot programmatically access the same Exchange server that I access via Outlook. Instead, there is different server that was set up to handle programmatic connections, and I have to target that one.
linda russel
Ranch Hand

Joined: Jan 05, 2012
Posts: 86
Thanks :-)
linda russel
Ranch Hand

Joined: Jan 05, 2012
Posts: 86




i get the above error when my mvn test finishes. i do not understand why surefire-report.html is not getting generated !!!

my pom.xml is pasted below





what changes i need to do?
linda russel
Ranch Hand

Joined: Jan 05, 2012
Posts: 86
is there any command i need to run to get the site folder and surefire-report.html under it?


or any more plugins need to be added?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how do i send a email test report from maven