How to configure Lombok with maven-compiler-plugin?

前端 未结 7 1977
长情又很酷
长情又很酷 2020-12-15 07:12

I have a root module and submodule in maven in the project. I am trying to use Lombok. I have added


    org.projectlombok&         


        
7条回答
  •  囚心锁ツ
    2020-12-15 07:27

    I'm not sure what the difference is between lombok and lombok-maven-plugin, but my projects are configured with this dependency:

        
            org.projectlombok
            lombok-maven-plugin
            1.16.12.0
        
    

    I haven't experimented with root and submodule poms yet, as my projects all tend to be rather isolated from each other. Not sure if that could be causing an issue for you.

    If you are using Eclipse, have you run the lombok.jar file and pointed it to your eclipse.exe file? it needs to modify the .exe in order for Eclipse to know that those getters and setters are coming, so that Eclipse doesn't complain during development.

    Edit: I'm using maven-compiler-plugin:

            
                org.apache.maven.plugins
                maven-compiler-plugin
                3.6.1
                
                    1.8
                    1.8
                
            
    

提交回复
热议问题