Maven project correctly uses @data annotations in Lombok

Source: Internet
Author: User

Today weekend double Hugh oneself at home again integrated the SSM frame, write model layer when suddenly think of the company with @dtata annotation is also very convenient to think this also add a Lombok dependency, so in Pom.xml file add

<dependencies>
    <dependency>
        <groupId>org.projectlombok</groupId>
        < artifactid>lombok</artifactid>
        <version>1.16.10</version>
    </dependency>
</dependencies>

But it backfired on me. @data Annotations on entity classes are found without this comment, and no Lombok-related jar packages are found. So I put a Lombok jar package and placed it under MAVEN's local repository.

This jar package is then introduced in the Eclipse project.

@data can be used later, but I try to use the object of the entity class. Their Getter,setter method is to find No.

Later it was learned to enter the command line in the directory where this jar exists, enter: Java-jar lombok-1.16.16.jar command.

Here is a little trick, you just in the file directory that the CMD will go directly into the terminal and in the current file path, it is not so troublesome step by step in the terminal input CD XXX command into the file you want to enter.

After entering the command, you will see a page of pepper and prompt you to install it on which IDE, select the IDE in which your project is located and click Install.

Will jump out of the other interface and follow its three-step tip:
1. Add Lombok related jar packages to the project
2. First exit the IDE and then open the IDE
3.clear reconstruction Project

After that, you can use it in a refreshing way.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.