Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions.idx files get not generated in Elipse although annotation processing is activated #30

Open
egloffmark opened this issue May 1, 2019 · 3 comments

Comments

@egloffmark
Copy link

egloffmark commented May 1, 2019

I tried to run your demo application with the development mode (-Dpf4j.mode=development) in Eclipse. I realized that the extension files get not generated in the "target/classes/META-INF" folder although I have activated on the plugin projects the Java compiler option "Enable Annotation Processing".

Selection_001

If I run the Maven build to produce the jar files then the extension files are packed inside the jar files. So I assume it is a problem of the Eclipse processing? I am using Eclipse v2019-03 and Java 1.8 and version 0.5.0 of your project

Please see the log statements when I start your demo "boot" application
log.txt

@egloffmark
Copy link
Author

egloffmark commented May 1, 2019

It is definitely an eclipse issue - if I just run "maven compile" then the "extensions.idx" files get generated.

I could solve the issue by either configuring Eclipse to use for the Annotations your "pf4j-2.6.0.jar" by adding it explicitly to the "FactoryPath" in the Annotations Settings. This of course is not a preferred option so I need to have always the jar file located somewhere and maintained.

Selection_003

The better way is to use the additional eclipse plugin "m2e-apt" (https://marketplace.eclipse.org/content/m2e-apt). This generates a new configuration menu option at the project settings. There you can activate / synchronize the annotation processing with the maven plugin.

Selection_004

However not sure why such an explicit configuration / workaround is necessary. May be Eclipse has changed or your PF4J project need to be updated so Eclipse would automatically detect the annotation processors when the processing has been activated? would be good if you can clarify this issue.

@decebals
Copy link
Member

decebals commented May 1, 2019

They are some issues that make reference to Eclipse:

For no extensions issue:

I don't use Eclipse in my projects so I know too much about it, but I am sure that a lot of PF4J users use Eclipse. If I can improve something please create a PR or add a comment with what I can do.

@cwiechmann
Copy link

cwiechmann commented Oct 28, 2019

I'm using Eclipse as well and can confirm, that I'm having exactly the same problem. Just added the pf4j....jar to the "Factory path" as shown above and with that it is working.
@decebals, I'm unfortunately not used to the Java Annotations API and missed some background information about what it does or should do.
Therefore I'm thinking it might be worth to add a few more words about it at this place:

PF4J uses Java Annotation Processing to process at compile time all classes annotated with @extension and to produce the extensions index file.

And maybe add a link for further reading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants