Could not find method jdependMain() for arguments

624 views Asked by At

I am trying to run JDepend plugin via gradle. I have following jdepend.gradle file:

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

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

    • 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.

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.834 secs

Could you please help me to understand what's wrong? Thanks.

Regards, Sergii

1

There are 1 answers

2
Sergii Sopin On

I was applying JDepend plugin to the main project and it was the problem. I needed to apply it to all sub-projects instead.