-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Description
Description
Using guava-gwt from Gradle, when resolving a "runtime" configuration, the j2objc-annotations dependency is missing. This is because it's declared in the jreApiElements
variant but not in the jreRuntimeElements
one.
When using Maven, or explicitly disabling Gradle module metadata, the dependency will be there as it's declared with the default <scope>compile</scope>
in Maven (Maven lacking an equivalent to Gradle's compileOnlyApi
).
As a workaround, the dependency can be explicitly added to the project.
Example
See attached project; build it with
./gradlew assemble
You can add --info to see the exact command-line for the GWT compiler.
Expected Behavior
Compilation should succeed.
Actual Behavior
Compilation fails, GWT complaining about the j2objc annotations.
Edit build.gradle.kts
to uncomment the j2objc-annotations dependency and rebuild, now it should compile without error.
You can also run ./gradlew dependencies
and compare the compileClasspath
and runtimeClasspath
dependency trees (note that the latter will also contain gwt-dev
and all its dependencies):
./gradlew dependencies --configuration compileClasspath
./gradlew dependencies --configuration runtimeClasspath
Packages
No response
Platforms
GWT
Checklist
- I agree to follow the code of conduct.