Lombok with Spring Tool Suite 4

后端 未结 13 2079
长发绾君心
长发绾君心 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:28

    None of the steps worked for me as the file dialog box won't even let me select the directory containing the SpringToolSuite4.ini

    So I did the following:

    1. Get lombok-.jar from either your ~/.m2/repository/org/projectlombok/lombok// If not available you can get it from mvn repository: https://mvnrepository.com/artifact/org.projectlombok/lombok/1.18.6

    2. copy the lombok-.jar to /Applications/SpringToolSuite4.app/Contents/Eclipse as lombok.jar

      cp /path/to/lombok.jar /Applications/SpringToolSuite4.app/Contents/Eclipse/
      
    3. Edit the file: /Applications/SpringToolSuite4.app/Contents/Eclipse/SpringToolSuite4.ini inside the directory to add this last line:

      -javaagent:/Applications/SpringToolSuite4.app/Contents/Eclipse/lombok.jar
      
    4. Open your project in eclipse. Right click on Maven -> update project. Follow similar step if you're using another build tool (like Gradle)

提交回复
热议问题