Recently I created a project in Kotlin that used Kotlin DSL for the build.gradle.kts file and I used Gradle 7.4.2 but after upgrading to 8.0.2 I'm unable to set attributes for manifest. I did that to set the main class for creating the jar file.
A portion of my build.gradle.kts:
tasks.jar {
manifest {
attributes["Main-Class"] = "io.github.yamin8000.twitterscrapper.MainKt"
}
configurations["compileClasspath"].forEach { file: File ->
from(zipTree(file.absoluteFile))
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
IDE complains that No set method providing array access for line 3.
So what's the alternative to array access which looks unavailable in Gradle 8.x.?
It's an old question but maybe this could help someone.
manifest.attributesis an object of typeAttributes. What you should do is: