I successfully configured the plugin to work well on my local machine.

Basically here what I have

        <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
        
<sonar.cobertura.reportPath>target/site/cobertura/coverage.xml</sonar.cobertura.reportPath>
        <sonar.core.codeCoveragePlugin>cobertura</sonar.core.codeCoveragePlugin>

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

I run the build with

mvn clean cobertura:cobertura verify sonar:sonar

The problem is that test are run two times. One with cobertura another with 
surefire. How to stop surefire running the tests for second time. -DskipTests 
appears to influence cobertura as well. I cannot use two separate commands 
because the build is executed on Bamboo

Thanks

Reply via email to