Hi, I am experiencing some trouble running Detekt on one of our Kotlin (JVM) projects through Gradle. I have it configured in Gradle/Groovy with a basic
detekt {
toolVersion = "1.0.0-RC14"
input = files("src/main/kotlin")
filters = ".*/resources/.*,.*/build/.*"
}
I get loads of errors in the console, all with the following message:
Analyzing '[filename redacted]' led to an exception.
The original exception message was: java.lang.NoClassDefFoundError: io/gitlab/arturbosch/detekt/rules/LinesOfCodeKt$tokenSequence$1
Running detekt '1.0.0-RC14' on Java '1.8.0_151-b12' on OS 'Mac OS X'.
(am running Gradle 5.4.1)
What I’ve tried
- Building and running Detekt via the CLI - this works fine, and gives me a report (I ran it on the same project that fails via the Gradle).
- Switching to version 1.0.0-RC13 via Gradle yields the same errors as with RC14
- Clearing out the gradle caches and
gradle clean
does not seem to have any effect
- (edit) Running the gradle task inside a Docker container using
gradle@latest
image doesn’t help
Ideally, I want it to be run via Gradle - does anyone have any pointers as to what may the cause of this issue, or perhaps how I can fix it?