Eclipse 拒绝支持 lombok 注解
我正在使用 Eclipse 版本:2021-09 (4.21.0) 内部版本号:20210910-1417 Lombok:1.18.12
但 Eclipse 在“问题”选项卡中抱怨: “RootResponse 类型的方法 getTest() 未定义”
问题类别是:
@Getter
@Builder
@ToString
public class RootResponse extends Serializer {
private String test;
// for use in the cleanup routine
@Override
public String[] getDeletionIdentifiers() {
throw new UnsupportedOperationException("Deletion not supported: "+ this.getClass().getName());
}
}
我正在使用 Gradle,但远不是这方面的专家。尽管如此,我认为这与 build.gradle 文件相关:
ext {
groupId = project.property('groupId')
version = project.property('version')
lombok_version='1.18.12'
functional_api_test_version='1.0-SNAPSHOT'
redwoodCommonVersion='3.5-SNAPSHOT'
}
dependencies {
compile group: 'com.tii', name: 'redwood-common', version: "${redwoodCommonVersion}"
implementation "org.projectlombok:lombok:${lombok_version}"
annotationProcessor "org.projectlombok:lombok:${lombok_version}"
testAnnotationProcessor "org.projectlombok:lombok:${lombok_version}"
implementation 'com.tii:java-functional-testlib:0.5-SNAPSHOT'
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.4.0-b180830.0359'
testCompile 'junit:junit:4.12'
}
在 Eclipse 中单击 @Getter 注释,它会找到并打开 lombok.Getter 注释。
我想在 Eclipse 中以不需要签入和修改源代码的方式修复此问题。我怎样才能强制 Eclipse 这样做呢?
谢谢,樵夫
I'm using
Eclipse Version: 2021-09 (4.21.0) Build id: 20210910-1417
Lombok: 1.18.12
But Eclipse complains in the "Problems" tab:
"The method getTest() is undefined for the type RootResponse"
The problem class is:
@Getter
@Builder
@ToString
public class RootResponse extends Serializer {
private String test;
// for use in the cleanup routine
@Override
public String[] getDeletionIdentifiers() {
throw new UnsupportedOperationException("Deletion not supported: "+ this.getClass().getName());
}
}
I'm using Gradle, but am far from an expert at it. Nonetheless, I think this is relevant from the build.gradle file:
ext {
groupId = project.property('groupId')
version = project.property('version')
lombok_version='1.18.12'
functional_api_test_version='1.0-SNAPSHOT'
redwoodCommonVersion='3.5-SNAPSHOT'
}
dependencies {
compile group: 'com.tii', name: 'redwood-common', version: "${redwoodCommonVersion}"
implementation "org.projectlombok:lombok:${lombok_version}"
annotationProcessor "org.projectlombok:lombok:${lombok_version}"
testAnnotationProcessor "org.projectlombok:lombok:${lombok_version}"
implementation 'com.tii:java-functional-testlib:0.5-SNAPSHOT'
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.4.0-b180830.0359'
testCompile 'junit:junit:4.12'
}
I also tried adding an external library to Eclipse:
If I click on the @Getter annotation in Eclipse, it finds and opens the lombok.Getter annotation.
I'd like to fix this in Eclipse in a way that I don't need to check in and modify the source. How can I force Eclipse to do this?
Thx, Woodsman
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论