```./gradlew ktlintFormat > Task :auth:runKtlin...
# community-support
k
Copy code
./gradlew ktlintFormat
> Task :auth:runKtlintFormatOverKotlinScripts FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':auth:runKtlintFormatOverKotlinScripts'.
> A failure occurred while executing org.jlleitschuh.gradle.ktlint.worker.KtLintWorkAction
   > HEADER_KEYWORD
Can someone help with this I tried all possible ways and I am running out of options...It is related to this https://github.com/JLLeitschuh/ktlint-gradle/issues/816 and I followed the recommendation in the github issue which is to add the following lines but it still doesnt work. I am using kotlin 2.1.0
Copy code
configure<KtlintExtension> {
  version.set("1.5.0")
}
v
Did you do that configuration in the build script of
auth
where you also apply the
ktlint-gradle
plugin and where the error is happening?
k
build.gradle.kts
this file imports another file which looks like this
Copy code
plugins {
    `kotlin-dsl`
    id("org.jlleitschuh.gradle.ktlint") version "12.1.1"

}

group = "gov.cdc.prime.reportstream"

repositories {
    mavenCentral()
    maven { url = uri("<https://repo.spring.io/snapshot>") }
    gradlePluginPortal()
}

kotlin {
    jvmToolchain(17)
}

dependencies {
    val kotlinVersion by System.getProperties()
    implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
    implementation("org.jlleitschuh.gradle.ktlint:org.jlleitschuh.gradle.ktlint.gradle.plugin:12.1.1")
}
so what exactly should I do? @Vampire
sorry I am not an advanced user of gradle
v
What is the path to the file where you tried the work-around?
k
this is the project structure
Copy code
myproject
   /buildSrc
        /build.gradle.kts
        /shared.gradle.kts
    /prime-router
         /build.gradle.kts
I run
./gradlew ktlintFormat
from
myproject
v
That sounds unlikely. The path in your OP says the task that fails is
:auth:runKtlintFormatOverKotlinScripts
But there is no project
auth
in the structure you just posted.
k
Copy code
myproject
   /buildSrc
        /build.gradle.kts
        /shared.gradle.kts
    /prime-router
         /build.gradle.kts
    /auth
         /build.gradle.kts
    /submissions
          /build.gradle.kts
oh so I should have this in sumbissions and auth build.gradle.kts?
Copy code
configure<KtlintExtension> {
  version.set("1.5.0")
}
v
The problem is in
auth
so you probably need the workaround there, yes.
🙌 1
And usually it should be
Copy code
ktlint {
    version = "1.5.0"
}
unless you are on ancient Gradle versions or do not use the
plugins { ... }
block to apply plugins