Lombok is not generating getter and setter

前端 未结 20 1732
走了就别回头了
走了就别回头了 2020-11-29 19:10

I just tried to send a Maven-based project to another computer and HORROR, red markers everywhere!!

However, mvn clean install is building just fine.

相关标签:
20条回答
  • 2020-11-29 19:16

    When starting with a fresh eclipse installation you, in fact, need to "install" Lombok before being able to use it.

    1. Go where you Lombok jar is (e.g. (e.g. you can find in ~/.m2/repository/org/projectlombok/lombok/1.16.10/lombok-1.16.10.jar), run it (Example: java -jar lombok-1.16.10.jar). A window should appear, browse to your eclipse.exe location.
    2. Click on install.
    3. Launch Eclipse, update project configuration on all projects and voila.
    0 讨论(0)
  • 2020-11-29 19:16

    1) Run the command java -jar lombok-1.16.10.jar. This needs to be run from the directory of your lombok.jar file.

    2) Add the location manually by selecting the eclipse.ini file(Installed eclipse directory). Through “Specify location

    Note : Don't add the eclipse.exe because it will make the eclipse editor corrupt.

    How to add the eclipse.ini file

    0 讨论(0)
  • 2020-11-29 19:16

    When using lombok on a fresh installation of Eclipse or STS, you have to:

    1. Install the lombok jar which you can get at https://projectlombok.org/download. Run the jar (as Administrator if using windows) and specify the path to your Eclipse/STS installation.

    2. Restart your IDE (Eclipse or STS)

    3. Give some time for eclipse to generate the class files for lombok (Might take a up to 4 mins in some cases)

    0 讨论(0)
  • 2020-11-29 19:16

    Download Lombok Jar File https://projectlombok.org/downloads/lombok.jar

    Add maven dependency:

       <dependency>
          <groupId>org.projectlombok</groupId>
          <artifactId>lombok</artifactId>
          <version>1.16.18</version>
       </dependency>   
    

    Start Lombok Installation java -jar lombok-1.16.18.jar

    find complete example in this link:
    https://howtodoinjava.com/automation/lombok-eclipse-installation-examples/

    0 讨论(0)
  • 2020-11-29 19:18

    If you use STS. You must have Lombok installed in your Eclipse by running lombok-abc.jar

    Please Following the Steps:

    -Include pom in Maven . -Exit/Shutdown STS(must) -Find lombok Jar in ~.m2\repository\org\projectlombok\lombok\1.18.12 -From Command

    After then

    After then select the STS.exe

    After then click to update/update

    then Quit Installer

    Happy Coding

    Blockquote

    0 讨论(0)
  • 2020-11-29 19:20

    For Spring ToolSuite 4 on Mac, they renamed the ini to SpringToolSuite4.ini.

    You can either rename or copy it to STS.ini to be recognized by lombok. Then copy it back to the original name to be read by the IDE. (Haven't tried if symbolic links work though.)

    0 讨论(0)
提交回复
热议问题