I am using Maven-surefire-report plugin to generate junittest 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?
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.