Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use lombok plugin in Android Studio?

Tags:

I installed lombok from 'Preferences -> Plugin', but it's not working when I am trying to generate Getter & Setter. My code doesn't recognize it.

Is there anyone having idea how to setup lombok and use it to generate getter & setter annotation?

like image 340
Sumit T Avatar asked Jun 23 '16 12:06

Sumit T


People also ask

What is the use of Lombok plugin?

What is Lombok. Project Lombok (from now on, Lombok) is an annotation-based Java library that allows you to reduce boilerplate code. Lombok offers various annotations aimed at replacing Java code that is well known for being boilerplate, repetitive, or tedious to write.

How do I add Lombok jar to my project?

Adding the Lombok Plugin in IDE (Eclipse) Downloaded jar from https://projectlombok.org/download or use the jar which is downloaded from your maven build. Execute command in terminal: java -jar lombok. jar. This command will open window as show in the picture below, install and quit the installer and restart eclipse.

How do you use Lombok in spring boot gradle?

For Lombok to work, we need to turn on annotations processing. To do that, go to File -> Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors and mark “Enable annotation processing”.


1 Answers

You need not only to install Lombok Plugin, but also add dependency to build.gradle:

dependencies{     compileOnly 'org.projectlombok:lombok:1.18.12'     annotationProcessor 'org.projectlombok:lombok:1.18.12' //or v. 1.16.2 in your case. } 

More info on official guide.

Another answer with instructions.

like image 57
Yurets Avatar answered Sep 19 '22 03:09

Yurets