aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes [Maven] Nice HTML test-reports 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 "[Maven] Nice HTML test-reports" Watch "[Maven] Nice HTML test-reports" New topic
Author

[Maven] Nice HTML test-reports

Tiago Fernandez
Ranch Hand

Joined: May 16, 2003
Posts: 167
Hi again,

I need to generate decent test-reports (HTML) using Maven, not those uglies XML's. I used to do it using Ant, but I wonder if already exists the same feature in Maven. I know I can use maven site:generate, but it produces a lot of other things, and I just want the test reports

Any idea?

Thx!

[ July 20, 2005: Message edited by: Tiago Fernandez ]
[ July 20, 2005: Message edited by: Tiago Fernandez ]

Tiago Fernandez
http://www.tiago182.spyw.com/
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30973
    
159

Tiago,
Maven has a junitreport plugin, similar to the one used by JUnit. This converts the ugly XML into HTML.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243
Hi,

Originally posted by Tiago Fernandez:
I know I can use maven site:generate, but it produces a lot of other things, and I just want the test reports


I include a maven.xml file in the same top level directory that has the project.xml file. In here, you can de-register some reports that you don't want to be included when you run site:generate.

In my case, I de-register all the reports that rely on CVS access because late last year we upgraded our version of CVS which introduced date-parsing problems for all of these maven CVS reports. So instead of generating the website and having empty reports for these categories, I de-register them from the build task. This is what my maven.xml looks like, you should be able to customize to remove the reports that you are not interested in by using this as a template:



SCJP 1.4 91%, SCJP 1.5 88%, SCJD B&S
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: [Maven] Nice HTML test-reports