How to make maven cobertura and surefire plugins work together?

I put surefire and cobertura plugins in my pom.xml , but I cannot configure them to work properly. Either cobertura does not start or tests are run twice.

So, how can I configure plugins to work together and only once?

If I configure this way, cobertura does not start:

 <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.5.1</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.12</version> </plugin> 

If I tune in this way, the tests run twice:

 <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.5.1</version> <executions> <execution> <phase>test</phase> <goals> <goal>cobertura</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.12</version> </plugin> 
+7
source share
1 answer

Tests will be performed twice - the way it is. See Samuel comment on starting units and cobertura with maven

0
source

All Articles