我想在 Android 项目上使用 PIT (pitest.org) 插件。我正在使用 Android Maven 插件并且有一个相当标准的 POM。Android JAR 包含在 Maven 中,具有提供的范围并包含实际源代码,而不是 SDK 中的存根 JAR。
通过 Maven 插件从命令行运行 PIT 失败:
[ERROR] Failed to execute goal org.pitest:pitest-maven:1.1.3:mutationCoverage (default-cli) on project easystat: Executi
on default-cli of goal org.pitest:pitest-maven:1.1.3:mutationCoverage failed: Coverage generation slave exited abnormall
y!
[ERROR]
[ERROR] Please copy and paste the information and the complete stacktrace below when reporting an issue
[ERROR] VM : Java HotSpot(TM) 64-Bit Server VM
[ERROR] Vendor : Oracle Corporation
[ERROR] Version : 25.25-b02
[ERROR] Uptime : 3804
[ERROR] Input ->
[ERROR] 1 : -Dclassworlds.conf=C:\Users\Tom\maven\bin\..\bin\m2.conf
[ERROR] 2 : -Dmaven.home=C:\Users\Tom\maven\bin\..
[ERROR] BootClassPathSupported : true
[ERROR]
[ERROR]
[ERROR] Please copy and paste the information and the complete stacktrace below when reporting an issue
[ERROR] VM : Java HotSpot(TM) 64-Bit Server VM
[ERROR] Vendor : Oracle Corporation
[ERROR] Version : 25.25-b02
[ERROR] Uptime : 3804
[ERROR] Input ->
[ERROR] 1 : -Dclassworlds.conf=C:\Users\Tom\maven\bin\..\bin\m2.conf
[ERROR] 2 : -Dmaven.home=C:\Users\Tom\maven\bin\..
[ERROR] BootClassPathSupported : true
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.pitest:pitest-maven:1.1.3:mutationCov
erage (default-cli) on project easystat: Execution default-cli of goal org.pitest:pitest-maven:1.1.3:mutationCoverage fa
iled: Coverage generation slave exited abnormally!
Please copy and paste the information and the complete stacktrace below when reporting an issue
VM : Java HotSpot(TM) 64-Bit Server VM
Vendor : Oracle Corporation
Version : 25.25-b02
Uptime : 3804
Input ->
1 : -Dclassworlds.conf=C:\Users\Tom\maven\bin\..\bin\m2.conf
2 : -Dmaven.home=C:\Users\Tom\maven\bin\..
BootClassPathSupported : true
之前关于 Google Groups 的一些讨论表明,包含旧版本的 JUnit 可能会导致这样的错误,并且看起来 Android JAR 包含 3.x JUnit 库之一(感谢 Android 团队......)。为了确认或否认这种预感,我想从 PIT 的类路径中排除 Android JAR,因为无论如何我已经在 Surefire 测试阶段这样做了,但我看不到任何这样做的选项。
有没有办法从 PIT 中排除提供的依赖项,而不必更改该依赖项的范围?