Lombok

Lombok and STS issue - Method undefined

旧街凉风 提交于 2019-12-04 19:13:03
问题 I have STS versioned 3.6.3.SR1 that's based on Eclipse Luna 4.4.1. I have did the following steps: 1) Donwload and run the lombak runnable jar and gave the path of my STS. 2) I verified the entries of vmargs, but was missing Xbootclasspath and added it to have like, -vmargs -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m -Dorg.eclipse.swt.browser.IEVersion=10001 -Xms512m -Xmx1024m -javaagent:C:\tools\Lombok\lombok.jar -Xbootclasspath/a:C:\tools\Lombok\lombok.jar 3) I have exit and opened

Lombok not working in a Netbeans project

人盡茶涼 提交于 2019-12-04 18:47:06
问题 I want to use Lombok in a project to use @Getter and @Setter. I included using Maven: <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.12.6</version> <scope>provided</scope> </dependency> Import is OK for Netbeans: import lombok.Getter; import lombok.Setter; But auto setters and getters don't work (no autocompletion / "cannot find symbol ..."). Strange thing is that for another project I have it's working fine! But I can't figure the differences. I

Lombok and AspectJ

不问归期 提交于 2019-12-04 18:46:49
问题 Im trying to use Lombok in combination with AspectJ and Maven. So, what's the problem? When i use the AspectJ Maven Plugin (www.mojohaus.org/aspectj-maven-plugin/), it takes the sources and compiles them and ignores changes made by Lombok. I followed this tutorial and came up with this code and AspectJ works, but Lombok dies with this message: [WARNING] You aren't using a compiler supported by lombok, so lombok will not work and has been disabled. Your processor is: org.aspectj.org.eclipse

How to use Lombok @Builder annotation on Methods

微笑、不失礼 提交于 2019-12-04 16:23:59
问题 I want to have an easy way to construct test data and have found the Builder pattern to be a good fit as described here. However to reduce boilerplate codes in the component tests, even more, I have found @Builder from Project Lombok to be a nice candidate to try. However, I can't find any documentation or online examples on how to use it on a method. I want to use @Builder on some sort of factory method since I can't make any changes to the implementation. Can someone give an example on how

View lombok generated code in IntelliJ IDEA

泄露秘密 提交于 2019-12-04 15:07:58
问题 I have the lombok plugin setup in IntelliJ and my code builds fine. I can see the lombok generated methods in the structure view. What I want is some way to actually see the source lombok generates for each of the methods. I realize I can delombok the file but I'm wondering if there is some way I can flip a switch to show or hide the lombok generated code. 回答1: Just in case somebody ends up looking for an answer here. With lombok plugin starting with v0.8.6 it is possible. 回答2: Lombok comes

How to exclude property from Lombok builder?

旧巷老猫 提交于 2019-12-04 14:59:20
问题 I have a class called as "XYZClientWrapper" , which have following structure: @Builder XYZClientWrapper{ String name; String domain; XYZClient client; } What I want no build function generated for property XYZClient client Does Lombok supports such use case? 回答1: Yes, you can place @Builder on a constructor or static (factory) method, containing just the fields you want. Disclosure: I am a Lombok developer. 回答2: Alternatively, I found out that marking a field as final , static or static final

Use Maven Compiler Plugin with Eclipse Compiler and Lombok

五迷三道 提交于 2019-12-04 09:57:31
Is there a way to compile lomboked code in ECJ without setting lombok as javaaagent for the maven process? The snippet below only works if I run mvn with lombok as agent <profile> <id>ecj</id> <build> <pluginManagement> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <compilerId>eclipse</compilerId> </configuration> <dependencies> <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-compiler-eclipse</artifactId> <version>2.8-SNAPSHOT</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId>

Gradle deprecated annotation processor warnings for lombok

血红的双手。 提交于 2019-12-04 08:57:36
问题 After upgrading to gradle 4.7, my previously warning-free build now emits this warning: The following annotation processors were detected on the compile classpath: 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor' and 'lombok.launch.AnnotationProcessorHider$ClaimingProcessor'. Detecting annotation processors on the compile classpath is deprecated and Gradle 5.0 will ignore them . Please add them to the annotation processor path instead. If you did not intend to use annotation