Lombok problem

Today, I studied Dubbo as a distributed open source project Dubbo app.

In order to eliminate the conflict and interference of some dependencies, I open up a new workspace. At the same time, I also make a compressed package for classified backup of the company's project dependencies.

As a result, Dubbo app, an open source project, has its own Maven library.

The Lombok problem we want to talk about here today is that the related entities in Dubbo app use Lombok annotations and cannot call the setget method. Therefore, errors are reported before compilation.

Errors, that is, common red labels.

The reason for the problem is that eclipse does not install the corresponding Lombok. Therefore, to solve this problem, you need to install the corresponding Lombok and configure eclipse INI file.

Some people may ask why we should use Lombok and use it instead of using the setget method that can be generated only by shortcut keys.

The reason is simple: Lombok eliminates redundant code by reducing getters and setters of POJO classes through annotation

For Lombok official website and jar package address, please refer to the following website:

Lombok official website: https://projectlombok.org/ Jar package download path: https://projectlombok.org/download

Installation steps:

(1) Add Lombok Jar to the installation directory of eclipse

(2) In eclipse Add the following two lines at the end of the in file

-Xbootclasspath/a:lombok.jar
-javaagent:lombok.jar


(3) Restart eclipse (if you find that there are errors when restarting eclipse, remember project update, and you will find that those errors will disappear immediately, and the problem will be solved by now)

Reference problem solving website: https://blog.csdn.net/icecoola_/article/details/77414572

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>