-
-
Notifications
You must be signed in to change notification settings - Fork 424
Closed
Labels
Description
Expected and Results
Here's a snippet of code that had some unexpected results:
plugins {
id 'java-library'
id("com.gradleup.shadow") version("9.0.0-beta10")
}
repositories {
mavenCentral()
}
dependencies {
implementation("io.grpc:grpc-netty-shaded:1.63.0")
implementation("io.grpc:grpc-core:1.63.0")
}
shadowJar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
mergeServiceFiles()
}I was expecting that this would remove any duplicate files introduced between the 2 libs that I'm shadowing, but merge the service files.
Apparently, service files don't "merge" because duplicates are being excluded. Removing the DuplicatesStrategy.EXCLUDE seems to properly merge the service files.
In the above case, look for the file META-INF/services/io.grpc.NameResolverProvider in the generated jar.
Related environent and versions
Java:
openjdk version "17.0.14" 2025-01-21
OpenJDK Runtime Environment Temurin-17.0.14+7 (build 17.0.14+7)
OpenJDK 64-Bit Server VM Temurin-17.0.14+7 (build 17.0.14+7, mixed mode, sharing)
H/W:
mac mini m4 running macOS 15.3.2
Reproduction steps
No response
Anything else?
No response