Skip to main content

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

I actually saw this limitation before, and I did "mvn install" the project with the AP and closed it, but that didn't help, no matter what I tried.
I did open a new workspace though just now, created a new project, and imported the AP as a dependency the same way I did before.
This time everything seems to work... I'll go back to the old project now and try to figure out what's wrong with it. Maybe eclipse still remembers the project was opened there before?



On Tue, Feb 7, 2017 at 7:51 PM, Fred Bricon <fbricon@xxxxxxxxx> wrote:
There's a limitation in Eclipse JDT where you can't have a workspace project running annotation processors loaded from another workspace project.


There's nothing we can do at the m2e-apt level. Try disabling workspace resolution, see if this helps, but then you'll have to regularly run mvn install on your AP project.

On Tue, Feb 7, 2017 at 12:31 PM, Dagan Sandler <dagansandler@xxxxxxxxx> wrote:
Yeah, can't get it working with Eclipse :\



On Sun, Feb 5, 2017 at 7:22 PM, Anton Tanasenko <atg.sleepless@xxxxxxxxx> wrote:
Did you try (turning it off and on again) forcing maven project update (alt+f5)?

2017-02-05 19:06 GMT+02:00 Dagan Sandler <dagansandler@xxxxxxxxx>:
Hi,
So I'm actually using m2e-apt already, and it's enabled for all projects, but for some reason it's not configuring the project to use the Annotation Processor

I'm really not sure what I'm missing here.


On Sun, Feb 5, 2017 at 2:13 PM, Anton Tanasenko <atg.sleepless@xxxxxxxxx> 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
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



--
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


_______________________________________________
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



--
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


_______________________________________________
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



--
"Have you tried turning it off and on again" - The IT Crowd
And if that fails, then http://goo.gl/tnBgH5

_______________________________________________
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