PITest 问题:属性 'mainClass' 是最终的,不能再更改
PITest Issue: property 'mainClass' is final and cannot be changed any further
我最近将我的项目从 Java 8
升级到 Java 11
和 Gradle 6.5
。
但是,当我 运行 命令 ./gradlew pitest
时,我收到以下错误:
Execution failed for task ':pitest'.
> The value for task ':pitest' property 'mainClass' is final and cannot be changed any further.
这是我在 build.gradle
中的 pitest
设置:
pitest {
pitestVersion = '1.4.3'
targetClasses = ['com.myproject.*']
excludedClasses = [
'com.myproject.configuration.*',
'com.myproject.controller.*',
]
threads = 10
enableDefaultIncrementalAnalysis = true
historyInputLocation = ['build/reports/pitest/fastermutationtesting']
historyOutputLocation = ['build/reports/pitest/fastermutationtestingoutput']
outputFormats = ['XML', 'HTML']
timestampedReports = true
mutationThreshold = 90
}
这是我的 pitest
相关依赖项:
Plugins{
id "info.solidsoft.pitest" version '1.3.0'
}
testCompile 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.3.0'
我不确定这个 mainClass
属性 来自哪里,也没有找到关于这个问题的任何相关答案或文档。
我能够通过将依赖版本升级到以下版本来解决我的问题:
id "info.solidsoft.pitest" version '1.5.1'
和
testCompile 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.4.0'
增加依赖版本后,命令 ./gradlew pitest
正常工作,pitest 运行 正常。
我最近将我的项目从 Java 8
升级到 Java 11
和 Gradle 6.5
。
但是,当我 运行 命令 ./gradlew pitest
时,我收到以下错误:
Execution failed for task ':pitest'.
> The value for task ':pitest' property 'mainClass' is final and cannot be changed any further.
这是我在 build.gradle
中的 pitest
设置:
pitest {
pitestVersion = '1.4.3'
targetClasses = ['com.myproject.*']
excludedClasses = [
'com.myproject.configuration.*',
'com.myproject.controller.*',
]
threads = 10
enableDefaultIncrementalAnalysis = true
historyInputLocation = ['build/reports/pitest/fastermutationtesting']
historyOutputLocation = ['build/reports/pitest/fastermutationtestingoutput']
outputFormats = ['XML', 'HTML']
timestampedReports = true
mutationThreshold = 90
}
这是我的 pitest
相关依赖项:
Plugins{
id "info.solidsoft.pitest" version '1.3.0'
}
testCompile 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.3.0'
我不确定这个 mainClass
属性 来自哪里,也没有找到关于这个问题的任何相关答案或文档。
我能够通过将依赖版本升级到以下版本来解决我的问题:
id "info.solidsoft.pitest" version '1.5.1'
和
testCompile 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.4.0'
增加依赖版本后,命令 ./gradlew pitest
正常工作,pitest 运行 正常。