Skip to content

Navigation Menu

Sign in
Sign up

Document Gradle base-plugin variant-resolution gotcha and its jvm-ecosystem workaround #8590

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

Open
pangwangshu wants to merge 1 commit into google:master
base: master
Choose a base branch
Loading
from pangwangshu:wapang/issue8398
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ For more information on when to use `api` and when to use `implementation`,
consult the
[Gradle documentation on API and implementation separation](https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_separation).

If your Gradle project applies only the `base` plugin (not `java`,
`java-library`, or `jvm-ecosystem`) and picks up Guava only transitively
(through another dependency), you may see dependency resolution fail with
`NoCompatibleVariantsFailure`. This happens because Guava's Gradle module
metadata tags each variant with an `org.gradle.jvm.environment` attribute (to
pick between `-jre` and `-android`), and only Java-aware plugins register the
Gradle schema needed to interpret that attribute. Applying
[`jvm-ecosystem`](https://docs.gradle.org/current/userguide/jvm_ecosystem_plugin.html)
alongside `base` registers that schema, without adding any Java build tasks:

```gradle
plugins {
base
`jvm-ecosystem`
}
```

## Snapshots and Documentation

Snapshots of Guava built from the `master` branch are available through Maven
Expand Down

AltStyle によって変換されたページ (->オリジナル) /