我在Android中有一个带有Maven的项目,有几个集成测试。
在pom中使用以下配置:
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>17</platform>
</sdk>
<test>
<coverage>true</coverage>
<createReport>true</createReport>
</test>
</configuration>
<extensions>true</extensions>
<executions>
<execution>
<id>pull-coverage</id>
<phase>post-integration-test</phase>
<goals>
<goal>pull</goal>
</goals>
<configuration>
<pullSource>/data/data/com.package/files/coverage.ec</pullSource>
<pullDestination>${project.basedir}/target/jacoco.exec</pullDestination>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
当所有测试成功时,覆盖文件被拉出来,我可以在Sonar中使用它。但是,如果其中一个测试失败,则会在设备中生成coverage文件,但是从不执行pull-coverage任务,我无法在项目中获取报告。
我试图执行android任务:拉入测试失败;但我收到以下消息:
Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.0:pull (default-cli) on project xxxx: Execution default-cli of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.0:pull failed: Required parameter android.pull.source has no value. Please supply with -Dandroid.pull.source=value on the command line or as property or plugin configuration in your pom or settings file.
我的pullSource在我的pom中定义。
如果我的某个测试失败,我怎么能用maven获取覆盖率报告?