Closed jiritobias closed 3 years ago
The error here comes from the maven-compiler-plugin, which means you didn't setup your build correctly.
<scope>provided</scope>
,If I do that, I at least get an error from GWT:
[INFO] --- gwt-maven-plugin:1.0.0:codeserver (default-cli) @ test ---
[INFO] Ignoring test:test-shared:jar:1.0-SNAPSHOT; neither a gwt-lib or jar:sources; Did you forget to use <type>gwt-lib</type> in the dependency declaration?
[INFO] Turning off precompile in incremental mode.
[INFO] Super Dev Mode starting up
[INFO] workDir: /var/tmp/test/test/target/gwt/codeserver
[WARNING] 2020-10-17 18:46:42.184:INFO::main: Logging initialized @1101ms
[INFO] Loading Java files in test.App.
[INFO] Tracing compile failure path for type 'test.App'
[INFO] [ERROR] Errors in 'file:/var/tmp/test/test/test-client/src/main/java/test/App.java'
[INFO] [ERROR] Line 42: The method getA() is undefined for the type Test
[INFO] Tracing compile failure path for type 'test.Test'
[INFO] [ERROR] Errors in 'file:/var/tmp/test/test/test-client/src/main/java/test/Test.java'
[INFO] [ERROR] Line 3: lombok cannot be resolved to a type
[INFO] Finding entry point classes
[INFO] Tracing compile failure path for type 'test.App'
[INFO] [ERROR] Errors in 'file:/var/tmp/test/test/test-client/src/main/java/test/App.java'
[INFO] [ERROR] Line 42: The method getA() is undefined for the type Test
[INFO] [ERROR] Hint: Check that the type name 'test.App' is really what you meant
[INFO] [ERROR] Hint: Check that your classpath includes all required source roots
Running with -X
I can see the lombok JAR correctly present in the classpath, and the-javaagent
correctly passed in:
[DEBUG] Arguments: -javaagent:/home/tbr/.m2/repository/org/projectlombok/lombok/1.18.14/lombok-1.18.14.jar=ECJ com.google.gwt.dev.codeserver.CodeServer -failOnError -workDir /var/tmp/test/test/target/gwt/codeserver -sourceLevel 1.8 -launcherDir /var/tmp/test/test/target/gwt/launcherDir -allowMissingSrc -src /var/tmp/test/test/test-client/src/main/java -src /var/tmp/test/test/test-client/target/generated-sources/annotations -src /var/tmp/test/test/test-shared/src/main/java -src /var/tmp/test/test/test-shared/target/generated-sources/annotations test.App
Interestingly, mvn package
works.
That should help you figure out what else is missing. I myself avoid Lombok like the COVID: in my experience, being a hacky way of hacking into compilers, it always causes more problems than it supposedly solves. Either that or try to use delombok instead :man_shrugging:
Anyway, if there's some kind of "incompatibility", it is with GWT itself and not the gwt-maven-plugin (an if it's with GWT, it's IMO a Lombok problem, not a GWT one)
@tbroyer thanks, it works. Problem was scope + jvmArgs in client -> it has to be in root pom :)
I created new project form archetype and added lombok dependency and lombok javaagent to javmArgs (client pom).
But when create simple Lombok class in client module like {code} and try make instance of class Test and get value of a
new Test().getA();
then client cannot be run (mvn gwt:codeserver -pl modular-app-client -am).It throws error
Adding log with -X parameter. gwt.log