Vertispan / j2clmavenplugin

Maven plugin to launch new J2CL compilation
https://vertispan.github.io/j2clmavenplugin/
Apache License 2.0
53 stars 27 forks source link

Unable to Compile Maven Project with Guava using j2cl-maven-plugin #270

Open loveslikey opened 1 month ago

loveslikey commented 1 month ago

I am currently working on a project where I'm attempting to use the j2cl-maven-plugin to compile Java code for use in a browser environment. I've noticed that in the official demo, bazel-helloworld, libraries like Guava are being utilized successfully. However, when I try to import these same libraries (e.g., Guava ) into my Maven project using the j2cl-maven-plugin, the compilation fails. I've searched for documentation or examples that might explain how to properly include these libraries in a Maven project with j2cl-maven-plugin, but haven't found anything relevant.

Could you please provide guidance on how to successfully use libraries like Guava with j2cl-maven-plugin in a Maven project? Is there a special configuration or additional steps that I need to follow?

Thank you for your assistance!

Error info:
ImmutableList cannot be resolved to a type [ERROR] com.major.j2cl:acss:1.0-SNAPSHOT/transpiled_js: Error:E:\project\idea_speace\j2clDemo\target\gwt3BuildCache\...\stripped_sources\App.java:39: ImmutableList cannot be resolved

maven dependency <dependency>\n <groupId>com.google.guava</groupId> <artifactId>guava-gwt</artifactId> <version>32.1.1-jre</version> </dependency>