Vertispan / j2clmavenplugin

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

latest 0.21-SNAPSHOT fails to compile sources that has @Generated annotation #208

Open vegegoku opened 2 years ago

vegegoku commented 2 years ago

Testing the the plugin version 0.21-SNAPSHOT result in a lot of errors while running j2cl:watch over sources that have the javax.annotation.Generated annotation

[ERROR] org.dominokit.i18n:gwt-cldr:1.0/transpiled_js: Error:CurrencyList_.java:5: The import javax.annotation.Generated cannot be resolved
[ERROR] org.dominokit.i18n:gwt-cldr:1.0/transpiled_js: Error:CurrencyList_.java:10: Generated cannot be resolved to a type
[ERROR] org.dominokit.i18n:gwt-cldr:1.0/transpiled_js: Error:CurrencyList_af.java:6: The import javax.annotation.Generated cannot be resolved
[ERROR] org.dominokit.i18n:gwt-cldr:1.0/transpiled_js: Error:CurrencyList_af.java:10: Generated cannot be resolved to a type
[ERROR] org.dominokit.i18n:gwt-cldr:1.0/transpiled_js: Error:CurrencyList_af_NA.java:6: The import javax.annotation.Generated cannot be resolved
[ERROR] org.dominokit.i18n:gwt-cldr:1.0/transpiled_js: Error:CurrencyList_af_NA.java:10: Generated cannot be resolved to a type
[ERROR] org.dominokit.i18n:gwt-cldr:1.0/transpiled_js: Error:CurrencyList_af_ZA.java:6: The import javax.annotation.Generated cannot be resolved
[ERROR] org.dominokit.i18n:gwt-cldr:1.0/transpiled_js: Error:CurrencyList_af_ZA.java:10: Generated cannot be resolved to a type
niloc132 commented 2 years ago

It looks like it might be possible to add https://search.maven.org/artifact/javax.annotation/jsr250-api/1.0/jar as a dependency for your project instead of assuming that j2cl should add this class? In your case, the gwt-cldr project should list this jar as a dependency (and possibly its sources jar, so that j2cl can pick up the sources as well).

tobias-hammerschmidt commented 1 year ago

I'm affected by this issue since I'm using the dominokit library within my project. Since the library hasn't been updated yet I can't update to version 0.21.0 of j2cl maven plugin. I tried to add a dependency to the jsr-250 api as well as its sources to my project but still the issue persists. Is there any workaround available?

tobias-hammerschmidt commented 1 year ago

@niloc132 I just tried to update to j2cl version 0.22.0 but this issue persists. Is there any workaround available or do I have to wait for an update of org.dominokit.i18n:gwt-cldr?

niloc132 commented 1 year ago

This isn't explicitly fixed by the j2cl-maven-plugin (at this time, though we could potentially patch it into our fork of j2cl itself...), but instead should be a dependency of the library that has generated code in it - so yes, that might be a new release of domino's gwt-cldr fork. @vegegoku what do you think?

vegegoku commented 1 year ago

I agree, I can work on that.

tobias-hammerschmidt commented 1 year ago

I think the issue is closed with domino-jackson 1.0.2/gwt-cldr 1.0.1. I finally switched to j2cl-maven-plugin 0.22.0 and everything compiles flawlessly.