Lombok with Spring Tool Suite 4

后端 未结 13 2074
长发绾君心
长发绾君心 2020-12-28 09:01

I\'ve recently installed the new Spring Tool Suite 4 in macOS High Sierra but when I tried to run Lombok\'s installation it wouldn\'t find my STS installation,

I fol

相关标签:
13条回答
  • 2020-12-28 09:32

    I'll show you how to completely install lombok into Spring Tool Suite 4 or latest version. First go to your project pom.xml file and add this dependency on dependencies section.

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <scope>provided</scope>
    </dependency>
    

    Go to your project root folder on your IDE and click the right button on it. Select like below:

    And make sure, checked Force Update of Snapshots/Releases. Click Ok to download and update dependencies.

    After finishing all task. Go to project Maven Dependencies and find lombok.jar file (>Maven Dependencies >lombok.jar). Right click on lombok jar. Go to Run As Java Application.

    It will open lombok installer window and click ok. Then click Specify Location button.

    Select the location where your STS bundle was installed. If it is selected properly then it will checked STS.exe, like below:

    Then click install/update button. Finally lombok will be installed successfully.

    Hopefully it helps you. Thanks.

    0 讨论(0)
  • 2020-12-28 09:34

    on macOS Catalina all I had to do was to use lombok 1.18 and all worked fine.

    0 讨论(0)
  • 2020-12-28 09:35

    I did it in a different way. just did the below.

    1. Copy the lombok.jar to the root directory of STS
    2. Added "-javaagent:lombok-1.16.18.jar" to the SpringToolSuite4.ini

    It worked for me.

    0 讨论(0)
  • 2020-12-28 09:36

    I did install Lombok in Spring Tool Suite 4 just some days ago for Mac and Windows. And none problems.

    One:

    Execute java -jar lombok.jar

    • Note: normally or by default, it does not find the installer, it is the common scenario in my experience.

    Two:

    Press the Specify Location button.

    • Note: for Mac, go to the Contents directory within the .app file and find the STS.ini file, it could be SpringToolSuite4.ini too.

    Conclusion: therefore for any OS, the goal is find the unique file with the .ini extension

    Normally I do this with the IDE closed.

    0 讨论(0)
  • 2020-12-28 09:36

    I renamed SpringToolSuite4.exe and SpringToolSuite4.ini to STS.exe and STS.ini. Then used lombok installer's Specify Location to find them. After lombok installed, I renamed those files back to their original names.

    0 讨论(0)
  • 2020-12-28 09:37
    1. Turn off STS
    2. Install lombok following other common guidances with jar.
    3. Turn on STS
    0 讨论(0)
提交回复
热议问题