xenomachina
04/05/2023, 7:54 PMExecution failed for task ':jar'.
> Entry ....class is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.5.1/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.We know we can add a duplicate strategy...
tasks.withType(Jar) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
...but we'd like to understand why this is happening in the first place. What changed between 1.8.10 and 1.8.20 that's causing duplicate class files to be generated?
We're using Gradle 7.5.1, in case it matters.tapchicoma
04/05/2023, 8:03 PMxenomachina
04/05/2023, 8:28 PMtapchicoma
04/06/2023, 7:54 AMxenomachina
04/07/2023, 12:22 AMbuildscript {
...
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
...
apply plugin: 'kotlin'
where $kotlin_version
is set in gradle.properties
.xenomachina
04/07/2023, 12:22 AMapply
line to:
apply plugin: "org.jetbrains.kotlin.jvm"
as documented here, and I get the same behavior: it works in 1.8.10, but complains about duplicate class files in 1.8.20.xenomachina
04/07/2023, 5:07 PMclasspath "org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfu_version" // atomicfu_version = 0.20.1
...
apply plugin: 'kotlinx-atomicfu'
We are no longer using the features of this plugin, so I removed it from our build, and the duplicate class error is gone.