我可以在开发模式下将 Lombok 与 GWT 结合使用吗?

发布于 2024-12-20 03:05:32 字数 614 浏览 2 评论 0原文

我尝试按照 官方说明 在开发模式下运行 lomboked GWT 项目,但是我'我做错了什么,或者这不再适用于当前版本的 GWT?

我得到的错误是:

“MyData 类型未定义方法 setA(int)”。

MyData 很简单:

@Data
public class MyData {
  private int a;
}

我指定

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

(作为 VM 参数)。

我也尝试过玩

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

,以及从我的 ant 文件启动开发模式等。

问题是,我主要只是猜测整个设置应该如何工作,所以而不是对我的问题进行故障排除糟糕的尝试,我想问一下正确的设置是什么样的?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

っ〆星空下的拥抱 2024-12-27 03:05:32

您现在可能已经可以使用它了,但我可以确认它确实可以与 GWT2.4 / Eclipse 3.7 一起使用。唯一需要的选项是 -javaagent VM arg,并将 lombok.jar 添加到类路径/构建路径。

我认为当您第一次开始使用它时,会遇到一些问题,与 gwt-unitCache 文件夹和 war/WEB-INF/classes 文件夹有关,清除这些可能是设置它时的一个很好的步骤!

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 !

昔日梦未散 2024-12-27 03:05:32

我认为您偶然发现了问题 393。如果是这种情况,您可以尝试最新的 edge 版本

披露:我是 lombok 项目的成员之一开发商。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文