Skip to content

Commit db65f2e

Browse files
fabianisherequrbonzoda
authored andcommitted
Exclude duplicate classes for Jar task
This change changes the `duplicatesStrategy` for the `jmhBenchmarkJar` tasks to exclude duplicate classes. With Gradle 7, complex dependencies (where the same class might exist multiple times) can cause the build to fail due to the default `duplicatesStrategy` triggering a failure. Fixes #39
1 parent 6ca2c55 commit db65f2e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugin/main/src/kotlinx/benchmark/gradle/JvmTasks.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ fun Project.createJvmBenchmarkCompileTask(target: JvmBenchmarkTarget, compileCla
3131
dependsOn("${target.name}${BenchmarksPlugin.BENCHMARK_COMPILE_SUFFIX}")
3232
conventionMapping.map("classifier") { "JMH" }
3333
manifest.attributes["Main-Class"] = "org.openjdk.jmh.Main"
34-
34+
35+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
36+
3537
from(project.provider {
3638
compileClasspath.map {
3739
when {

0 commit comments

Comments
 (0)