Skip to content

guava-gwt should publish Gradle module metadata or somehow fix POM #7134

@tbroyer

Description

@tbroyer

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.

sscce.zip

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions