Can I use Lombok with GWT in Development Mode?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 06:05:38

问题


I tried to follow the official instructions on running a lomboked GWT project in dev mode, but either I'm doing something wrong, or this doesn't work with current versions of GWT anymore?

The error I get is:

"The method setA(int) is undefined for the type MyData".

MyData is simple:

@Data
public class MyData {
  private int a;
}

I'm specifying

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

in my Eclipse Run Configuration (as a VM argument).

I also tried playing around with

-Xbootclasspath/p:/path/to/lombok.jar

, as well as starting dev mode from my ant file, etc.

The problem is, that I'm mostly just guessing how the whole setup should work, so instead of troubleshooting my poor attempts, I'd like to ask how a correct setup would look like?


回答1:


You've probably got it working by now, but I can confirm it does work with GWT2.4 / Eclipse 3.7 . The only option needed is the -javaagent VM arg, and adding lombok.jar to the classpath/buildpath.

I think there's some issues when you first start to use it, to do with either the gwt-unitCache folder, and the war/WEB-INF/classes folder, clearing these is probably a good step when setting it up !




回答2:


I think you've stumbled upon Issue 393. If that's the case you can try the latest edge release

Disclosure: I'm one of the project lombok developers.



来源:https://stackoverflow.com/questions/8414674/can-i-use-lombok-with-gwt-in-development-mode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!