You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Dani Lanaya <da...@gmail.com> on 2018/07/12 19:38:01 UTC

Annotation Processing support

Hi,

One of the projects I'm trying out Netbeans 9 for uses Lombok. But I don't
see the "Enable Annotation Processing" option on build that was apparently
available in 8.2 and is mentioned in the Lombok docs. So I'm getting a lot
of errors in my project.

Is this planned for support in 9, or, anything I can do?

Re: Annotation Processing support

Posted by Nils Hoffmann <ni...@web.de>.
I can confirm that using version 1.18.0 of the org.projectlombok
dependency in Maven projects fixes any issues in NetBeans 9vc3.

Thanks for bringing that up and providing a solution!

Cheers,
Nils


Am 13.07.2018 um 01:11 schrieb Dani Lanaya:
> After some testing I was able to get the sample project working. It
> was definitely an issue with the Lombok version, not with Netbeans.
> 1.16.x was being pulled in by the parent POM - but 1.18.x works as
> expected. So I have a workaround (add direct dependency) until my
> company upgrades the parent POM.
>
> For reference it produced the following exception in the logs:
>
>      [exec] INFO
> [com.sun.tools.javac.processing.JavacProcessingEnvironment]:
> Annotation processing error:
>      [exec] java.lang.ClassNotFoundException:
> com.sun.tools.javac.code.TypeTags
>
> Thanks for your help Gj.
> dani


Re: Annotation Processing support

Posted by Dani Lanaya <da...@gmail.com>.
After some testing I was able to get the sample project working. It was
definitely an issue with the Lombok version, not with Netbeans. 1.16.x was
being pulled in by the parent POM - but 1.18.x works as expected. So I have
a workaround (add direct dependency) until my company upgrades the parent
POM.

For reference it produced the following exception in the logs:

     [exec] INFO
[com.sun.tools.javac.processing.JavacProcessingEnvironment]: Annotation
processing error:
     [exec] java.lang.ClassNotFoundException:
com.sun.tools.javac.code.TypeTags

Thanks for your help Gj.
dani

Re: Annotation Processing support

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
1. Make sure its a direct dependency on Lombok.
2. In the Project Properties, go to Sources tab, and switch the
"Source/Binary Format" drop-down to 1.8 and see if that makes a difference
and then switch it back to how you had it.
3. If you still have a problem, set up a new project like shown here, i.e.,
from scratch: https://twitter.com/netbeans/status/1017501860976947200
4. Make sure you're using 9.0-vc3 and not something else, since that's the
environment I'm using and it works.

Gj



On Thu, Jul 12, 2018 at 10:57 PM, Dani Lanaya <da...@gmail.com>
wrote:

> Sorry, I don't mean to be vague, I'm just a little confused - what I mean
> is that though the imported Lombok annotations are resolved with no errors,
> the accessor methods/constructors/etc that should be generated by the
> annotations are not. Netbeans is underlining those in red and a Maven build
> using the packaged Maven fails but one run from the terminal succeeds.
>
> I'm not sure if I can be more specific although I could provide logs.
> Thanks for the help, I'm just really excited to try the new version, but
> having trouble sorting this out with the documentation.
>

Re: Annotation Processing support

Posted by Dani Lanaya <da...@gmail.com>.
Sorry, I don't mean to be vague, I'm just a little confused - what I mean
is that though the imported Lombok annotations are resolved with no errors,
the accessor methods/constructors/etc that should be generated by the
annotations are not. Netbeans is underlining those in red and a Maven build
using the packaged Maven fails but one run from the terminal succeeds.

I'm not sure if I can be more specific although I could provide logs.
Thanks for the help, I'm just really excited to try the new version, but
having trouble sorting this out with the documentation.

Re: Annotation Processing support

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Probably. Make it a direct dependency.

But I'm not going to spend time guessing what "showing errors" means --
you're going to need to be very specific.

Gj

On Thu, Jul 12, 2018 at 10:36 PM, Dani Lanaya <da...@gmail.com>
wrote:

> Hmm, I'm still showing errors. Lombok is included as a transitive
> dependency through the parent POM. Would that cause an issue?
>
> Thanks
> dani
>

Re: Annotation Processing support

Posted by Dani Lanaya <da...@gmail.com>.
Hmm, I'm still showing errors. Lombok is included as a transitive
dependency through the parent POM. Would that cause an issue?

Thanks
dani

Re: Annotation Processing support

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
No checkbox is needed if you're using Maven. Just add the dependency in
your POM.

https://twitter.com/netbeans/status/1017501860976947200

Thanks,

Gj


On Thu, Jul 12, 2018 at 10:30 PM, Dani Lanaya <da...@gmail.com>
wrote:

> Yeah, trying those exact steps, and the checkbox is not there. All I have
> are the options Compile on Save, Generate Debugging Info and Report Uses of
> Deprecated APIs.  It's a maven-based project and I verified lombok is in
> the dependencies.
>
> Must be missing something?
>
> On Thu, Jul 12, 2018 at 3:57 PM Geertjan Wielenga
> <ge...@googlemail.com.invalid> wrote:
>
>> Just tried it in 9.0-vc3 in a Maven project and Lombok works great.
>>
>> Gj
>>
>> On Thu, Jul 12, 2018 at 9:43 PM, Geertjan Wielenga <
>> geertjan.wielenga@googlemail.com> wrote:
>>
>>> For Maven-based projects: https://blogs.oracle.com/geertjan/lombok,-
>>> maven,-and-netbeans
>>>
>>> Gj
>>>
>>> On Thu, Jul 12, 2018 at 9:41 PM, Geertjan Wielenga <
>>> geertjan.wielenga@googlemail.com> wrote:
>>>
>>>> 1. Right-click a project and choose Properties.
>>>> 2. In Build | Compiling, there's the Enable Annotation Processing
>>>> checkbox.
>>>>
>>>> Gj
>>>>
>>>> On Thu, Jul 12, 2018 at 9:38 PM, Dani Lanaya <danichesebrough@gmail.com
>>>> > wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> One of the projects I'm trying out Netbeans 9 for uses Lombok. But I
>>>>> don't see the "Enable Annotation Processing" option on build that was
>>>>> apparently available in 8.2 and is mentioned in the Lombok docs. So I'm
>>>>> getting a lot of errors in my project.
>>>>>
>>>>> Is this planned for support in 9, or, anything I can do?
>>>>>
>>>>
>>>>
>>>
>>

Re: Annotation Processing support

Posted by Dani Lanaya <da...@gmail.com>.
Yeah, trying those exact steps, and the checkbox is not there. All I have
are the options Compile on Save, Generate Debugging Info and Report Uses of
Deprecated APIs.  It's a maven-based project and I verified lombok is in
the dependencies.

Must be missing something?

On Thu, Jul 12, 2018 at 3:57 PM Geertjan Wielenga
<ge...@googlemail.com.invalid> wrote:

> Just tried it in 9.0-vc3 in a Maven project and Lombok works great.
>
> Gj
>
> On Thu, Jul 12, 2018 at 9:43 PM, Geertjan Wielenga <
> geertjan.wielenga@googlemail.com> wrote:
>
>> For Maven-based projects:
>> https://blogs.oracle.com/geertjan/lombok,-maven,-and-netbeans
>>
>> Gj
>>
>> On Thu, Jul 12, 2018 at 9:41 PM, Geertjan Wielenga <
>> geertjan.wielenga@googlemail.com> wrote:
>>
>>> 1. Right-click a project and choose Properties.
>>> 2. In Build | Compiling, there's the Enable Annotation Processing
>>> checkbox.
>>>
>>> Gj
>>>
>>> On Thu, Jul 12, 2018 at 9:38 PM, Dani Lanaya <da...@gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> One of the projects I'm trying out Netbeans 9 for uses Lombok. But I
>>>> don't see the "Enable Annotation Processing" option on build that was
>>>> apparently available in 8.2 and is mentioned in the Lombok docs. So I'm
>>>> getting a lot of errors in my project.
>>>>
>>>> Is this planned for support in 9, or, anything I can do?
>>>>
>>>
>>>
>>
>

Re: Annotation Processing support

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Just tried it in 9.0-vc3 in a Maven project and Lombok works great.

Gj

On Thu, Jul 12, 2018 at 9:43 PM, Geertjan Wielenga <
geertjan.wielenga@googlemail.com> wrote:

> For Maven-based projects: https://blogs.oracle.com/geertjan/lombok,-
> maven,-and-netbeans
>
> Gj
>
> On Thu, Jul 12, 2018 at 9:41 PM, Geertjan Wielenga <
> geertjan.wielenga@googlemail.com> wrote:
>
>> 1. Right-click a project and choose Properties.
>> 2. In Build | Compiling, there's the Enable Annotation Processing
>> checkbox.
>>
>> Gj
>>
>> On Thu, Jul 12, 2018 at 9:38 PM, Dani Lanaya <da...@gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> One of the projects I'm trying out Netbeans 9 for uses Lombok. But I
>>> don't see the "Enable Annotation Processing" option on build that was
>>> apparently available in 8.2 and is mentioned in the Lombok docs. So I'm
>>> getting a lot of errors in my project.
>>>
>>> Is this planned for support in 9, or, anything I can do?
>>>
>>
>>
>

Re: Annotation Processing support

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
For Maven-based projects:
https://blogs.oracle.com/geertjan/lombok,-maven,-and-netbeans

Gj

On Thu, Jul 12, 2018 at 9:41 PM, Geertjan Wielenga <
geertjan.wielenga@googlemail.com> wrote:

> 1. Right-click a project and choose Properties.
> 2. In Build | Compiling, there's the Enable Annotation Processing checkbox.
>
> Gj
>
> On Thu, Jul 12, 2018 at 9:38 PM, Dani Lanaya <da...@gmail.com>
> wrote:
>
>> Hi,
>>
>> One of the projects I'm trying out Netbeans 9 for uses Lombok. But I
>> don't see the "Enable Annotation Processing" option on build that was
>> apparently available in 8.2 and is mentioned in the Lombok docs. So I'm
>> getting a lot of errors in my project.
>>
>> Is this planned for support in 9, or, anything I can do?
>>
>
>

Re: Annotation Processing support

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
1. Right-click a project and choose Properties.
2. In Build | Compiling, there's the Enable Annotation Processing checkbox.

Gj

On Thu, Jul 12, 2018 at 9:38 PM, Dani Lanaya <da...@gmail.com>
wrote:

> Hi,
>
> One of the projects I'm trying out Netbeans 9 for uses Lombok. But I don't
> see the "Enable Annotation Processing" option on build that was apparently
> available in 8.2 and is mentioned in the Lombok docs. So I'm getting a lot
> of errors in my project.
>
> Is this planned for support in 9, or, anything I can do?
>