简体   繁体   中英

Is there anyway in Idea to recognize a getter/setter generated by lombok in the same module

智能错误 So looking at my class files the getters/setters are being generated just fine, but I'm trying to write a copy method that looks like this in the same jar.

@Data
public class SoftwareVersions {
    private String applicationVersion;

    void copyTo( MonitorFoleyConnection mfc ) {
        mfc.setApplicationVersion( applicationVersion );
    }
}

in gradle

    annotationProcessor("org.projectlombok:lombok:1.+")
    compileOnly("org.projectlombok:lombok:1.+")

注释处理器设置

is it possible to get intellij to recognize the existance of this method?

Yes, you have. You just need to do two things:

  1. Install the Lombok Plugin for Intellij:

龙目岛插件

  1. Enable the annotation processing:

注释处理

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM