Eclipse 拒绝支持 lombok 注解

发布于 01-13 05:58 字数 1530 浏览 3 评论 0原文

我正在使用 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 添加外部库:

在 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:
enter image description here

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 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文