-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kotlinter 5.0.0 java.lang.NoClassDefFoundError: com/pinterest/ktlint/rule/engine/api/KtLintRuleEngine #423
Comments
This is executed on the repository root via a custom task like so: tasks.register("formatKotlinSources", FormatTask::class.java) {
description = "Formats specific Kotlin source files"
group = "Formatting"
source(files(providers.systemProperty("kotlin.files").map { it.split(",") }))
} |
Does the project in question apply one of the kotlin plugins such as jvm, multiplatform, or android? |
No, none of these plug-ins are applied there. Reason is that this is a quick task for a pre-commit hook that should execute as fast as possible with only little overhead. Again, with the 4.x versions this worked just fine, it only broke in the new 5.0.0. |
Understood. Yes, prior to 5.0.0, ktlint and all it's transitive dependencies were brought into the buildscript classpath when kotlinter plugin was applied. |
Before we only add the dependency configuration when a compatible kotlin plug is detected which doesn't work for projects with only custom kotlinter tasks. Fixes #423
Try 5.0.1, I think it fixes this issue. Reopen if not. |
No, unfortunately this is not fixed, I get the same error with 5.0.1:
This is my build environment:
|
Btw I can't reopen it, only if I closed it myself. |
I just upgraded to Kotlinter 5.0.0 and tried out the new way of configuring the ktlint version via the property like so (in a build convention plugin):
(Previously I used the BOM of ktlint as dependency alongside to Kotlinter and that just worked fine as is)
However, formatting actions fail then with
The text was updated successfully, but these errors were encountered: