Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Annotation Processors

You may want to try takari-lifecycle [1], which I believe has better annotation processing support, especially in m2e. It does err on the conservative side and will refuse perform operations known to work unreliable during incremental build. So if your annotation processor does not correctly provide originating element or generates one output file from multiple sources (which isn't supported well [2]), you'll know right away.

[1] https://github.com/takari/takari-lifecycle
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=447546

--
Regards,
Igor


On Sun, Feb 5, 2017, at 07:13 AM, Anton Tanasenko wrote:
Hey,
M2e does not configure jdt-apt itself (which is a pain to configure manually), but there is m2e-apt [1] which would do that for your.
As its description says, it's not enabled by default, you can either enable it globally in preferences or for each project separately (which is more preferable).

One thing to note though: due to eclipse compiler's incremental nature, some APs might not work properly, especially those that perform some aggregation of annotated classes at the end of processing round.


2017-02-05 13:46 GMT+02:00 Dagan Sandler <dagansandler@xxxxxxxxx>:
Hi,

I am trying to get familiar with writing Annotation Processors and having a difficulty with integration somewhere between maven/eclipse I think.

My setup is like so:
- Project A contains:
   - Annotation -  MyAnnotation
   - Annotation Processor -  MyProcessor
   - Service provider - src/main/resources/META-INF/services/javax.annotation.processing.Processor
This AP simply writes a mandatory warning message when the annotation is used on a class declaration.
The javax.annotation.processing.Processor contains the name of MyProcessor

-Project B contains:
   - Class B - annotated with MyAnnotation

When I compile everything from the command line - it all works well and I can see the warning generated by MyProcessor in the build output

But when I look at eclipse - I see no indication that the annotation processor is running at all. I tried installing Project A to the local repo and use it as a non-workspace dependency, but to no avail. The warning is still not showing.

Can you please help me?
I'll provide sample projects if needed




_______________________________________________
m2e-users mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit



--
Regards,
Anton.
_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users


Back to the top