• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

mail html junit reports in the message body using maven

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using Maven-surefire-report plugin to generate junit test report and maven-postman-plugin for mailing these reports. In the mail body I am getting the report but not in the format(or template) in which it is generated.
Do I need to send css files also along with the html file? Or Is there any other method of achieving this?

Thanks!
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you are saying that the HTML mail you are sending relies on external CSS files to format the email properly? If so, the options I know of are:

a) Change the CSS reference to be full URLs to a location that the email recipients have access to. (Never tried this myself, but it should work.)

b) Change the HTML template to include the <style> section and place the CSS contents there. That way the HTML is self-sufficient. (This is what I would do.)

But wait a minute, are you saying that you send one of the Maven-generated report HTML files? And that that HTML file is relying on Maven-generate CSS files? Hmm, that's more difficult. I don't know how to send a directory structure of files within an email message. What I would do is publish the reports as a site for the project and email an URL to the surefire report on that site. Essentially that is what we do for our Hudson builds - people can ask for an RSS feed on a project and they get updates each time the project builds. The projects all generate web sites complete with unit tests reports.
 
Rakesh Khob
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What will be the best way to include the CSS into the html file? The CSS and Html files are created as a part of surefire report generation.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looking at the surefire report options (http://maven.apache.org/surefire/maven-surefire-report-plugin/report-mojo.html), there is no option to do this. Looks like if you want the style information to be embedded in the HTML page, rather than be in a separate file, you'll have to modify the surefire report plugin.
 
Rakesh Khob
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I tried finding a way to do that, but bad luck!
Can anyone suggest what I can do?
 
joke time: What is brown and sticky? ... ... ... A stick! Use it to beat this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic