Domanda

I have a maven project with integration tests stored in a module called my-project-tests, and production code spread across several other modules. I can get code coverage for the unit tests of individual modules by adding the following plugin instruction to the pom.xml:

<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.5.7.201204190339</version>
    <executions>
        <execution>
            <goals>
                <goal>prepare-agent</goal>
            </goals>
        </execution>
        <execution>
            <id>report</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>report</goal>
            </goals>
        </execution>
    </executions>
</plugin>

I can then view the test report as described in the Netbeans wiki.

When I add this to my integration test module however, the report says "No data -- have you run your code yet?" (I have).

A jacoco.exec file is generated with a lot of data in it, I can't confirm if the data is correct. but a separate jacoco.xml file which Netbeans relies on is left mostly empty.

Is there a way to correctly produce and view code coverage of a multi-module project in Netbeans?

È stato utile?

Soluzione

According to this bug, this is not supported in Netbeans: https://netbeans.org/bugzilla/show_bug.cgi?id=223319

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top