cobertura-maven-plugin 2.1でカバレッジが100%になるバグの回避方法
Maven2でcobertura-maven-pluginの2.1には、レポートでカバレッジが常に100%になっちゃうバグがある。これはmaven-surefire-pluginでcoberturaのファイルを指定してやることで、正しい結果を得ることができる。2.0に戻したりする必要はありません。
<plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <systemProperties> <property> <name>net.sourceforge.cobertura.datafile</name> <value>${basedir}/target/cobertura/cobertura.ser</value> </property> </systemProperties> </configuration> </plugin> </plugins>