此内容没有您所选择的语言版本。

Chapter 10. Java Lombok


This section shows how to enable Lombok support in your Java projects. By default, the lombok.jar file is available in all Java plug-ins provided by CodeReady Workspaces.

To enable Lombok in a CodeReady Workspaces workspace, see the instructions below.

Prerequisites

  • A workspace or a devfile with:

    • One of the Java-based plug-ins enabled (redhat/java, redhat/java11, redhat/java8, redhat/quarkus-java8 or redhat/quarkus-java11)
    • A valid Lombok project to import

Procedure

  1. Open the workspace devfile.
  2. Edit the existing Java plug-in section, adding the preference:

      - id: redhat/java/latest
        preferences:
          java.jdt.ls.vmargs: '-javaagent:/lombok.jar'

Verification

  1. Start or restart the workspace.
  2. Open a file containing Lombok annotations.
  3. Verify that the Class outline contains the Lombok generated methods.

    Lombok

Additional resources

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.