简体   繁体   English

找不到方法jdependMain()作为参数

[英]Could not find method jdependMain() for arguments

I am trying to run JDepend plugin via gradle. 我正在尝试通过gradle运行JDepend插件。 I have following jdepend.gradle file: 我有以下jdepend.gradle文件:

apply plugin: 'jdepend'

// Repository definition to get JDepend libraries.
repositories {
    mavenCentral()
}

jdepend.reportsDir = file("${reporting.baseDir}/jdepend-output")

jdependMain {
    reports {
        text {
            enabled = 'true'
            destination = file("${jdepend.reportsDir}/jdepend.txt")
        }
        xml {
            enabled = !text.enabled
        }
    }
}

When I try to run build I have following error: 当我尝试运行构建时,出现以下错误:

gradle build -x test --parallel gradle build -x测试--parallel

Parallel execution with configuration on demand is an incubating feature. 并行执行和按需配置是一个孵化功能。

FAILURE: Build failed with an exception. 失败:构建失败,发生异常。

  • Where: Script 'C:\\Drive D\\Dev\\project\\projectName\\gradle\\jdepend.gradle' line: 10 其中:脚本'C:\\ Drive D \\ Dev \\ project \\ projectName \\ gradle \\ jdepend.gradle'行:10

    • What went wrong: A problem occurred evaluating script. 出了什么问题:评估脚本时发生问题。 Could not find method jdependMain() for arguments [jdepend_1dpftayagd693nuav7nmwvyci$_run_closure2@45128c37] on root project 'projectName' of type org.gradle.api.Project. 在类型为org.gradle.api.Project的根项目'projectName'上找不到参数[jdepend_1dpftayagd693nuav7nmwvyci $ _run_closure2 @ 45128c37]的方法jdependMain()。

    • Try: Run with --stacktrace option to get the stack trace. 尝试:使用--stacktrace选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output. 使用--info或--debug选项运行以获取更多日志输出。

BUILD FAILED 建立失败

Total time: 3.834 secs 总时间:3.834秒

Could you please help me to understand what's wrong? 您能帮我了解一下怎么了吗? Thanks. 谢谢。

Regards, Sergii 问候,Sergii

I was applying JDepend plugin to the main project and it was the problem. 我正在将JDepend插件应用于主项目,这就是问题所在。 I needed to apply it to all sub-projects instead. 我需要将其应用于所有子项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM