2

Set up new maven project with cobertura

It runs fine, classes getting instrumented and generates html report

but netbeans shows 0% coverage, the view never refreshes

    <cobertura.version>2.1.1</cobertura.version>
    <cobertura.plugin.version>2.7</cobertura.plugin.version>
.........
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <version>${cobertura.plugin.version}</version>
            <dependencies>
                <dependency>
                    <groupId>net.sourceforge.cobertura</groupId>
                    <artifactId>cobertura</artifactId>
                    <version>${cobertura.version}</version>
                </dependency>
            </dependencies>
            <executions>
                <execution>
                    <goals>
                        <goal>clean</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
Kalpesh Soni
  • 6,879
  • 2
  • 56
  • 59

2 Answers2

0

Have you included all relevant sections in the sample? Is clean the only goal you are executing? You also need to execute the check goal or the corbetura goal.

Your setup could be made much simpler just by specifying the corbetura plugins and also include the configuration in the reporting section of pom.xml. Follow instructions, refer to http://mojo.codehaus.org/cobertura-maven-plugin/usage.html#

KayDK
  • 134
  • 10
  • entire pom is huge, but i wanted to show the version of plugins I am using, again everything works fine on command line, but netbeans doesnt show it, netbeans bug? – Kalpesh Soni May 05 '15 at 16:42
  • Without looking into pom, I can't infer much. Have you tied the corbetura goal with any lifecycle of maven command using the phase tag? Say unit test life cycle for example. – KayDK May 05 '15 at 16:45
0

Netbeans has problems with cobertura 2.7. I dongraded to cobertura 2.6 and everything started working.

dantefff
  • 37
  • 3