twbbas
twbbas

Reputation: 447

Gradle task groovyDoc failing with NoClassDefFoundError

I'm using Gradle 1.5 to test my Groovy scripts. The groovyDoc task in build.gradle is set up like:

groovydoc {
    docTitle = "Name"
    windowTitle = "Name"
    destinationDir = file('file://path')
}

The error I'm getting when running this task is:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':groovydoc'.
> java.lang.NoClassDefFoundError: org/fusesource/jansi/AnsiRenderWriter

This only started happening after I made a minor code change (adding a single If statement) to one of my classes. I reverted to the previous commit and it does not have this problem. I tried deleting my change in the class and recommitting the same file but it is still failing.

Do you have any ideas?

Upvotes: 2

Views: 1408

Answers (2)

denise
denise

Reputation: 116

I upgraded to the current version of Gradle (1.10) and continued to get the same error.

Added the following to my build.gradle and now it's working.

configurations {
    jansi.extendsFrom(runtime)
}
groovydoc {
    def title = "IPDS ${version}"
    groovyClasspath = project.configurations.jansi
}
dependencies {
    jansi 'org.fusesource.jansi:jansi:1.11'
}

Upvotes: 6

Peter Niederwieser
Peter Niederwieser

Reputation: 123960

Sounds like a corrupt Gradle installation that's missing the Jansi Jar. Try to run with --full-stacktrace to learn more about the error.

Upvotes: 0

Related Questions