gpt4 book ai didi

java - PITest 问题 : property 'mainClass' is final and cannot be changed any further

转载 作者:行者123 更新时间:2023-12-01 16:18:53 29 4
gpt4 key购买 nike

我最近将我的项目从 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 - PITest 问题 : property 'mainClass' is final and cannot be changed any further,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62323783/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com