gpt4 book ai didi

gradle - 错误:尚未为属性 'checkstyleClasspath'指定值

转载 作者:行者123 更新时间:2023-12-03 03:27:20 24 4
gpt4 key购买 nike

为了检查所有子项目的代码风格。我创建一个文件checkstyle.gradle并将其应用于根目录中的build.gradle

apply plugin: 'checkstyle'


subprojects { project ->

task checkstyle(type: Checkstyle) {
configFile rootProject.file('checkstyle.xml')
ignoreFailures false
showViolations true
classpath = files()
source 'src/main/java'
}

// check code style after project evaluation
afterEvaluate {
project.tasks.findByName('checkstyle').execute()
}
}

发生错误。

* What went wrong:
>A problem occurred configuring project ':app'.
>A problem was found with the configuration of task ':app:checkstyle'.
> No value has been specified for property 'checkstyleClasspath'.



我不知道为什么会发生错误。

最佳答案

我只是知道如何解决此错误。

subprojects { project ->
apply plugin: 'checkstyle'

task checkstyle(type: Checkstyle) {
description 'Runs Checkstyle inspection against ICanPlayer sourcesets.'
group = 'Code Quality'
configFile rootProject.file('checkstyle.xml')
ignoreFailures false
showViolations true
classpath = files()
source 'src/main/java'
}

// check code style after project evaluation
afterEvaluate {
check.dependsOn('checkstyle')
}
}

关于gradle - 错误:尚未为属性 'checkstyleClasspath'指定值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49042970/

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