This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 257656 - Editor shows compile errors with lombok with Maven
Summary: Editor shows compile errors with lombok with Maven
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Windows 10
: P3 normal with 4 votes (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-21 04:25 UTC by benx
Modified: 2017-03-29 18:46 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (79.89 KB, text/plain)
2016-01-21 04:25 UTC, benx
Details
Screenshot for lomlok error (180.88 KB, image/png)
2016-01-21 04:30 UTC, benx
Details

Note You need to log in before you can comment on or make changes to this bug.
Description benx 2016-01-21 04:25:12 UTC
Product Version = NetBeans IDE Dev (Build 201601130401)
Operating System = Windows 10 version 10.0 running on amd64
Java; VM; Vendor = 1.8.0_66
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.66-b18

Reproducibility: Happens every time

STEPS:
  * Follow the steps to install lombok to my maven project (https://blogs.oracle.com/geertjan/entry/lombok_maven_and_netbeans)
  * "Save on compile" option is on.
  * Add lombok annotation @Slf4J, @Data to generate stuffs for a bean class.
  * Here is my simple test bean code:
	package benx;

	import static org.junit.Assert.assertEquals;

	import org.junit.Test;

	import lombok.Data;
	import lombok.ToString;
	import lombok.extern.slf4j.Slf4j;

	@Slf4j
	@Data
	@ToString
	public class LombokPlay {

		private String message = "Lombok is cool";

		@Test
		public void doAction() {
			log.info("lombok is COOL!!!");
			setMessage(message + " ^^");

			assertEquals("Lombok is cool ^^", getMessage());

			System.out.println(this.toString());
		}

	}

ACTUAL:
  Editor shows errors for lombok stuff, however, everything good when manually build the project.
  (This problem seems only in DEV build. Do the same in NetBeans 8.1 release, it works perfectly.)

EXPECTED:
  Compile correctly with lombok in maven projec
Comment 1 benx 2016-01-21 04:25:24 UTC
Created attachment 158201 [details]
IDE log
Comment 2 benx 2016-01-21 04:30:56 UTC
Created attachment 158202 [details]
Screenshot for lomlok error
Comment 3 INeedMySpace 2016-04-05 14:17:07 UTC
I have the similar issue:
NetBeans IDE 8.1 (Build 201510222201)
Java: 1.8.0_65; Java HotSpot(TM) 64-Bit Server VM 25.65-b01
maven project
lombok version 1.16.8
Simple example with several fields and @Data Annotation.

```
@Data
class HelloWorld {
    private String hello = "Hello";
    private String world = "World";
}
HelloWorld hw = new HelloWorld();
System.out.println(hw);
```

Building and running example returns
`local.HelloWorld@2a139a55`
setting lombok version to 1.14.4, clean and build/run - returns
`HelloWorld(hello=Hello, world=World)`
setting lombok version back to 1.16.8, clean and build/run - returns
`local.HelloWorld@2a139a55`

Running the same project (with lombok 1.16.8) directly with maven exec:exec plugin returns good results. It seems something is cached.
Comment 4 Quality Engineering 2016-05-26 01:57:49 UTC
Integrated into 'main-silver', will be available in build *201605260002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3e13526b1066
User: Svata Dedic <sdedic@netbeans.org>
Log: #257656: accept also subtypes
Comment 5 Rahul.khandelwal 2016-06-18 04:14:08 UTC
This issue is yet to be fixed.
I am using netbeans nightly build of 17th june 2016 and the lombok is not working in ide.
It's such an annoying issue, for now I am switching to idea community edition but hope this will be fixed in netbeans.
Comment 6 megascus 2016-10-07 07:59:13 UTC
Same issue occurs in NetBeans 8.2.

See https://github.com/rzwitserloot/lombok/issues/1194
Comment 7 _ gtzabari 2017-01-23 20:43:58 UTC
As noted in https://github.com/rzwitserloot/lombok/issues/1194 upgrading to Lombok 1.16.10 seems to fix the problem (this worked for me).
Comment 8 AlexFalappa 2017-03-08 12:58:21 UTC
As found by another user on https://github.com/rzwitserloot/lombok/issues/1194 only versions 1.16.10 and 1.16.12 work.

Previous 1.14.x and the latest 1.16.14 DO NOT work.
Comment 9 lucabur 2017-03-13 10:36:27 UTC
(In reply to AlexFalappa from comment #8)
> As found by another user on
> https://github.com/rzwitserloot/lombok/issues/1194 only versions 1.16.10 and
> 1.16.12 work.
> 
> Previous 1.14.x and the latest 1.16.14 DO NOT work.

I confirm: using 1.16.12 works, 1.16.14 DOES NOT
Comment 10 lsoares 2017-03-15 19:56:44 UTC
happening also to me.

NetBeans 8.2
Lombok 1.16.14
Spring Boot 1.5.2

any news?
Comment 11 mtbadi39 2017-03-24 17:12:35 UTC
Its lombok issue
No problem with lombok 1.16.16 (released 2 days ago) : https://github.com/rzwitserloot/lombok/releases/tag/v1.16.16