私はいくつかの単体テストを持っています(それらはAndroidテストですが、私はを使用しRobolectric
ているので、で実行されていますJVM
)。彼らは報道なしで幸せに走ります。
カバレッジで試してみると、emma-mavenからこのエラーが発生します。
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:emma-maven-plugin:1.0-alpha-3:instrument (default-cli) on project android: Execution default-cli of goal org.codehaus.mojo:emma-maven-plugin:1.0-alpha-3:instrument failed: class [com.larvalabs.svgandroid.ParserHelper] appears to be instrumented already
重要なビットはclass .... appears to be instrumented already
です。
適切なドキュメントを見つけるのは非常に困難ですが、これは私がさまざまなソースからの構成のためにまとめたものです。
<plugin>
<!-- This doesn't work, see below for a working configuration -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>emma-maven-plugin</artifactId>
<version>1.0-alpha-3</version>
<inherited>true</inherited>
<executions>
<execution>
<phase>process-classes</phase>
<configuration>
<filters>
<filter>-com.viewpagerindicator.*</filter>
<filter>-com.actionbarsherlock.*</filter>
<filter>-com.larvalabs.svgandroid.*</filter>
</filters>
</configuration>
<goals>
<goal>instrument</goal>
</goals>
</execution>
</executions>
</plugin>
問題は、不平を言っていたパッケージを除外したことです(問題は、これらがAndroidライブラリであるということだと思いました-プロジェクトが誤ってパスのリストに2回表示されてしまいます)、今では自分のパッケージについて不平を言っています。
同僚は、上記の<plugin>セクションを<project><build><pluginManagement>に入れるべきだと誤って提案しました。
<configuration>は直接<plugin>にあり、残りの<executions>ビットは削除されている必要があります。回答を参照してください。