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 184952 - Annotation processing doesn't work in Maven projects
Summary: Annotation processing doesn't work in Maven projects
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal with 9 votes (vote)
Assignee: Jesse Glick
: 186965 (view as bug list)
Depends on:
Blocks: 178108
  Show dependency tree
Reported: 2010-04-26 08:25 UTC by Matthieu.P
Modified: 2017-08-07 15:53 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

Sample case (2.51 KB, application/zip)
2010-10-06 18:00 UTC, Jesse Glick
Lombok compilaton error (71.32 KB, image/png)
2010-11-25 15:44 UTC, jfurmankiewicz

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu.P 2010-04-26 08:25:38 UTC
New 6.9 annotation processing feature is really great and works perfectly in java or jee projects. However, Netbeans doesn't process annotations in maven projects. 

It should look in project and libs META-INF/services directory to find annotations processors factories.
Comment 1 David Simonek 2010-04-28 08:30:39 UTC
Please be more specific and tell us what exactly doesn't work and what error messages are you getting.
For example, @ServiceProvider annotations works OK for me - you just have to specify dependency of version 2.2 or higher of maven compiler plugin, because older versions don't process annotations correctly.
Comment 2 Matthieu.P 2010-04-28 11:45:36 UTC
Yep sorry i should have been more specific.

The issue is with annotation processing inside the IDE (the new feature of 6.9) not at compilation time. 

When i use Lombok for example, the @Data annotation adds getters and setters for all properties in my class. Those methods appears in the navigator window, and in auto completion on a Java project.

Now in my maven project, annotations are not processed and i can't use methods normally added by lombok. 

This is an IDE related issue i think.
Comment 3 Jesse Glick 2010-04-28 19:21:45 UTC
(In reply to comment #2)
> The issue is with annotation processing inside the IDE (the new feature of 6.9)
> not at compilation time. 

I.e. there is no AnnotationProcessingQueryImplementation in NbMavenProjectImpl.lookup.
Comment 4 Petr Jiricka 2010-06-16 11:42:40 UTC
This also affects the generation of the JPA canonical metamodel, see bug 181861.
Comment 5 Jesse Glick 2010-10-06 18:00:18 UTC
Created attachment 102289 [details]
Sample case
Comment 6 Jesse Glick 2010-10-06 18:35:30 UTC
core-main #8b313154fe61
Comment 7 Quality Engineering 2010-10-08 03:21:01 UTC
Integrated into 'main-golden', will be available in build *201010080000* on (upload may still be in progress)
User: Jesse Glick <>
Log: #184952: Annotation processing doesn't work in Maven projects
Comment 8 jfurmankiewicz 2010-11-25 15:44:13 UTC
Does not work with either 0.9.2 or 0.9.3 in NB 7.0 Beta.
Ubuntu 10.10, Sun JDK 1.6.21

All classes annotated with any Lombok annotations (@Data, @EqualsAndHashCode, @ToString) show up with compilation errors. Same code works fine in Eclipse.

Will attach screenshot
Comment 9 jfurmankiewicz 2010-11-25 15:44:52 UTC
Created attachment 103332 [details]
Lombok compilaton error

Compilation error always shows up on package statement
Comment 10 jfurmankiewicz 2010-11-25 17:34:31 UTC
The code for my project is in git if you want to grab it and try to reproduce it:
Comment 11 Jan Lahoda 2010-11-25 21:07:12 UTC
This was fixed as bug #192142 post-7.0 beta.
Comment 12 Jesse Glick 2010-12-03 18:28:41 UTC
*** Bug 186965 has been marked as a duplicate of this bug. ***
Comment 13 nebrass 2017-08-07 15:53:43 UTC
I still have this issue on NetBeans 7.3.1:

Product Version: NetBeans IDE 7.3.1 (Build 201306052037)
Java: 1.6.0_43; Java HotSpot(TM) 64-Bit Server VM 20.14-b01
Runtime: Java(TM) SE Runtime Environment 1.6.0_43-b01

Please help !