Question

I'm using the maven cobertura plugin to generate coverage reports, but for some reason, the instrument goal gets stuck in an infinite loop.

In my classes directory (named bin), an infinite loop occurs and creates directories named generated-classes/cobertura/generated-classes/cobertura...and on and on as long as I let the instrument goal run. Inside each of the cobertura directories are my instrumented classes. Any idea why this might occur?

Was it helpful?

Solution

Can you post your pom file? Or at least the relevant sections? You should have something like the following:

<build>
    <pluginManagement>
        <plugins>
...snip...              
            <!-- cobertura code coverage plugin -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <formats>
                        <format>xml</format>
                    </formats>
                </configuration>
            </plugin>
            <!-- end cobertura code coverage plugin -->

        </plugins>
    </pluginManagement>
</build>

<reporting>
<plugins>
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration>
            <formats>
                <format>xml</format>
            </formats>
        </configuration>
    </plugin>
</plugins>
</reporting>

Also, are you following the standard maven directory layout for your source? Where is your pom file with respect to your source files, and what does your directory layout look like?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top