-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gradle 8.3 does not properly resolve exclusion #26522
Comments
This was introduced by a change in Guava, I believe. Guava 32.0.1 does not show the |
Sorry that you're having trouble with Gradle! This is the intended behavior, and there’s no plan to change it. This issue will be closed. Maven and Gradle have different approaches to dependency resolution. See these issues for more context:
As you said, you can explicitly exclude the unwanted dependency in your build script as a workaround. |
OK, so modifying the gradle dependencies this way allowed the build, but re-instated dependencies {
implementation(platform("com.google.guava:guava-parent:32.1.2-jre"))
implementation "io.dropwizard:dropwizard-jackson:4.0.2"
} |
Copying the exclusion down a level also worked. dependencies {
implementation("io.dropwizard:dropwizard-jackson:4.0.2") {
exclude group: "com.google.code.findbugs"
}
} |
Current Behavior
With this build.gradle file:
./gradlew compileJava
failsDropwizard has excluded jsr305 (https://github.com/dropwizard/dropwizard/blob/release/4.0.x/dropwizard-dependencies/pom.xml#L106-L111, https://central.sonatype.com/artifact/io.dropwizard/dropwizard-dependencies)
And even though the dependency is listed in both
guava
andguava-parent
.That dependency is only excluded once:
Expected Behavior
I believe Gradle should exclude the dependency wherever it exists under that tree, not just the first time it happens. The output should be:
I know it seems like it should be a Dropwizard or Guava issue, but I'm here because it works on maven:
Context (optional)
I have to explicitly include Guava (or explicitly exclude it) in order to avoid ending up in this unbuildable state.
Steps to Reproduce
Unzip test-guava-restrict.zip and run
./gradlew cJ
.Gradle version
8.3
Build scan URL (optional)
No response
Your Environment (optional)
No response
The text was updated successfully, but these errors were encountered: