July
July

Reputation: 913

Does lombok work with GWT super dev mode?

I use lombok extensively at backend, it's really nice and I hope to integrate it into GWT, so I can take advantage of the magic.

I managed to let gwt-maven-plugin recognize lombok by using the -javaagent:lombok.jar=ECJ vm args to be able to compile successfully, however, I'm not sure how to make it work with GWT super dev mode, as it continues complaining "missing getter method" in my IDE(Intellij IDEA).

Also tried the delombok goal of lombok-maven-plugin but without luck. Any ideas?

Upvotes: 5

Views: 757

Answers (1)

Jaroslav Záruba
Jaroslav Záruba

Reputation: 4874

Make sure to delete your workDir before starting gwt:run-codeserver. This directory might contain files from previous (lombok-unaware) compilation attempts.

[INFO] --- gwt-maven-plugin:2.8.0-beta1:run-codeserver (default-cli) @ Web ---
[INFO] Turning off precompile in incremental mode.
[INFO] Super Dev Mode starting up
[INFO]    workDir: C:\Users\jzaruba\AppData\Local\Temp\gwt-codeserver-1653004051676437159.tmp

This is what my mvn-gwt-codeserver.bat looks like:

call mvn clean dependency:properties gwt:run-codeserver %*

(I added dependency:properties because my gwt-maven-plugin configuration refers to Lombok via project dependency: ${org.projectlombok:lombok:jar}, i.e. no static path.)

And if you don't like launching the codeserver from command line, this is how "VM arguments" in my "GWT Codeserver" launch configuration look like:

-javaagent:path/to/lombok.jar=ECJ

Upvotes: 2

Related Questions