Gradle groovydoc fails: org/codehaus/groovy/tools/groovydoc/ResourceManager

Hello,

I would like to generate the Groovy Documentation, if I use straight the predefined task “groovydoc”, I have the following issue :

>gradle groovydoc

:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:groovydoc FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:groovydoc’.

org/codehaus/groovy/tools/groovydoc/ResourceManager

If I defined a custom task in my build.gradle, such as:
//myGroovydocsSrc
task myGroovydocsSrc(type: Groovydoc) {
source sourceSets.main.allGroovy
destinationDir = new File(genLocalDirGroovySrc)
println "classpath= " + sourceSets.test.output.toString() + " " + sourceSets.test.compileClasspath.toString()
classpath = sourceSets.main.output + sourceSets.main.compileClasspath
println ("Creation of Groovy doc src in: " + genLocalDirGroovySrc)

doLast {
tasks.getVersion.execute()
}
}

I have the same error.

I am using gradle 2.4.

Does someone have any clue ?
Plus, I would like to generate the Groovydoc for the “tests” also.

Such as:
//myGroovydocsTest
task myGroovydocsTest(type: Groovydoc) {
source sourceSets.test.allGroovy
destinationDir = new File(genLocalDirGroovyTest)
classpath = sourceSets.test.output + sourceSets.test.compileClasspath
println ("Creation of Groovy doc Test in: " + genLocalDirGroovyTest)

doLast {
tasks.getVersion.execute()
}
}

thanks !
P.

Do you have a Groovy dependency for your project?

https://docs.gradle.org/current/userguide/groovy_plugin.html#N12D6C

Hello Sterling,

thanks a lot your your feedback, yes I have some Groovy dependencies for the project.

build.gradle extract:
dependencies {
// allows using Groovy 2.4.x
compile 'org.apache:commons-cli:1.2’
compile 'org.apache:commons-lang:2.+'
compile 'org.codehaus.groovy:groovy:2.4.+'
compile 'org.codehaus.groovy:groovy-templates:2.4.+'
compile 'org.yaml:snakeyaml:1.10’
compile group:“org.apache”, name: “log4j-api”, version: "2.1"
compile group:“org.apache”, name: “log4j-core”, version: "2.1"
compile 'com.googlecode.java-diff-utils:diffutils:1.3.0’
compile “com.evaderis:libToto:libTotoversion”

//compile 'org.junit:junit:4.12’
testCompile 'org.junit:junit:4.12’
testCompile ‘org.hamcrest:hamcrest-core:1.3’
}

Pierre

Thanks, I think you’re missing the org.codehaus.groovy:groovy-groovydoc:2.4.+ dependency.

If you don’t care about the bloat, you could use groovy-all instead.

Great, it works !! Thanks !!