| Behaviour of @MetaInfServices annotation [message #1849288] |
Tue, 11 January 2022 08:27  |
Eclipse User |
|
|
|
Hello,
I have a project that has 3 classes the implement a service interface "example.MyService". They all use the same annotation, something like (in 3 separate files):
@MetaInfServices(MyService)
public class MyServiceImplA implements MyService {
//...
@MetaInfServices(MyService)
public class MyServiceImplB implements MyService {
//...
@MetaInfServices(MyService)
public class MyServiceImplC implements MyService {
//...
The problem is that when eclipse compiles this, I expect to get a META-INF/services/example.MyService with all 3 classes (MyServiceImplA, MyServiceImplB, MyServiceImplC). Instead, only one of the 3 classes is present in the file. The other two are missing.
If I compile from command-line using maven, that produces a proper services file with all 3, so standard Java/Maven outside Eclipse seem to work fine.
What could be causing this? Any ideas what to check/change in order to fix this?
|
|
|
| Re: Behaviour of @MetaInfServices annotation [message #1849304 is a reply to message #1849288] |
Wed, 12 January 2022 05:05  |
Eclipse User |
|
|
|
I just tried it with the latest Eclipse and 1.8 meta-inf library and I see all files getting processed. I see the following in the services file:
MyServiceImplA
MyServiceImplB
MyServiceImplC
You may want to try with a more recent Eclipse if you aren't doing that already. Also, do you see anything in the problem view or error log? May be the compilation is interrupted for some reason?
|
|
|
Powered by
FUDForum. Page generated in 0.03265 seconds