With Maven I can generate multiple different types of code coverage reports with Cobertura by changing the reporting section of my POM, ala ...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<configuration>
<formats>
<format>html</format>
<format>xml</format>
</formats>
</configuration>
</plugin>
Alternately, I can generate a single type of report from the Maven command line, ala ...
mvn clean cobertura:cobertura -Dcobertura.report.format=xml
How can I generate multiple different report types from the Maven command line?
Apparently, I can only do one. ... I've tried this below, and it does not work!
mvn clean cobertura:cobertura -Dcobertura.report.formats=xml,html
(NOTE: The above property uses "formats" versus "format". The above always creates the default HTML report without seeing the two specified formats. I'm using Maven 3.2.3 and Cobertura plugin version 2.0.3.)
Please help, my Googol Fu is failing. ... Anyone know if this is possible or not?
Looks like that's not possible...
From Sonatype blog post Configuring Plugin Goals in Maven 3:
But in the code of the plugin:
As you can see
formats
doesn't haveexpression
tag (unlikeformat
) so it cannot be configured from the command line.Update
I just realised that I answered wrong question :) Question I answered is "How can I generate multiple different report types from the Maven command line using 'formats' option?". But original question was "How can I generate multiple different report types from the Maven command line?"
Actually there is a simple workaround - run maven twice (second time without
clean
), like this: