4

I have the following plugin defined for cobertura as follows. I have to run mvn cobertura:cobertura to get the code coverage report. How to edit the pom so that mvn install runs the cobertura ?

 <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <version>2.6</version>
            <executions>
                <execution>
                    <phase>install</phase>
                    <goals>
                        <goal>clean</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
atul
  • 95
  • 2
  • 5

1 Answers1

0

Cobertura have its own lifecycle. It executes all goals which cobertura coverage reporting need in specific order. See : How do I configure when cobertura tests run in maven-cobertura-plugin?

Only option would be to configure cobertura goals to be executed in default lifecycle phases, but since report generation goal is assumed to be run as Maven report:

http://mojo.codehaus.org/cobertura-maven-plugin/cobertura-mojo.html

is is IMO impossible to be done in easy way (or to be done at all).

Community
  • 1
  • 1
Grzesuav
  • 459
  • 2
  • 10