Hello,

I was wondering if someone could help me fix my surefire + cobertura
config.  I only want one unit tests to run ONE time, but when I add the
cobertura-maven-plugin to the reporting section, it seems to trigger another
surefire:test phase.  Any help?

Here is my current config:

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.2</version>
                <executions>
                    <execution>
                        <id>site</id>
                        <phase>pre-site</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>instrument</id>
                        <phase>site</phase>
                        <goals>
                            <goal>instrument</goal>
                            <goal>cobertura</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <forkMode>once</forkMode>
                    <systemProperties>
                        <property>
                            <name>
                                net.sourceforge.cobertura.datafile
                            </name>
                            <value>
                                target/cobertura/cobertura.ser
                            </value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>
        </plugins>

            ...

    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>
                    maven-project-info-reports-plugin
                </artifactId>
                <version>2.0.1</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>dependencies</report>
                            <report>cim</report>
                            <report>project-team</report>
                            <report>summary</report>
                            <report>issue-tracking</report>
                            <report>scm</report>
                            <report>index</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.4.2</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report-only</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.2</version>
            </plugin>

            ...

    </reporting>

-- 
Brian

Reply via email to