1

In my spring based multi-module maven project i want to generate cobertura code coverage report after running mvn clean install . Below is the part of cobertura maven-plugin of pom.xml which i am using

    <skipCobertura>false</skipCobertura>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>${mavencobertura.version}</version>
                    <configuration>
                        <skip>${skipCobertura}</skip>
                        <formats>
                            <format>html</format>
                            <format>xml</format>
                        </formats>
                        <aggregate>true</aggregate>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>test</phase>
                            <goals>
                                <goal>clean</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

mvn cobertura:cobertura is generating the report but i want it to be generated aftermvn clean install.

I added below in reporting part also:

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>cobertura</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
</reporting>


Ankit
  • 81
  • 2
  • 10

0 Answers0