For some reason, when you use the spotless plugin alongside Indra and that you use Ktlint for formatting, the license header is not applied in the source files.
Here is a test build.gradle.kts to reproduce this issue.
plugins {
kotlin("jvm") version "1.8.21"
id("com.diffplug.spotless") version "6.19.0"
id("net.kyori.indra.licenser.spotless") version "3.1.1"
}
group = "org.example"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib"))
}
spotless {
kotlin {
ktlint()
}
kotlinGradle {
ktlint()
}
}
indraSpotlessLicenser {
licenseHeaderFile(rootProject.file("HEADER.md"))
}
kotlin {
jvmToolchain(17)
}
For some reason, when you use the spotless plugin alongside Indra and that you use Ktlint for formatting, the license header is not applied in the source files. Here is a test
build.gradle.kts
to reproduce this issue.