Similar to @korn answer, I solved mine using the EXCLUDE
Strategy;
tasks.withType<Jar>() {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes["Main-Class"] = "MainKt"
}
configurations["compileClasspath"].forEach { file: File ->
from(zipTree(file.absoluteFile))
}
}