-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
pf4j-spring compatibility with Spring Boot #37
Comments
|
Hello, thanks for answering. I mean an example of use of this structure public class HelloPlugin extends SpringPlugin written in your example. How/where i should obtain/instantiate the SpringPlugin in the spring boot application? (i dont see it in the demo) Greetings. |
I don't understand your question, and what you are looking for. Take a look at demo application to see a concrete example. They are some examples/projects available on internet.
You don't need to obtain/instantiate the |
So, if i do something like this, i will obtain that HelloPlugin implementation?
Or how can i access to this HelloPlugin? |
SpringPlugin plugin = (SpringPlugin) pluginManager.whichPlugin(MyService.class); where You can also try with |
After I read again the description of the issue I want too add more clarifications:
You cannot. In documentation
Yes. I use this approach in my projects (but I don't use Spring). I run my application in development from my IDE (IntelliJ). In this mode (development) my application together with all the plugins looks like a regular multi module application. |
That is not correct, it is:
But that doesn't work, it returns null (or with getPlugin also returns null). Debugging it, within the class AbstractPluginManager the map plugins is always empty:
So, it is returning always null. Remember, im testing it without package it in a jar, the plugin (that HelloPlugin referenced in your documetantion) is just in source code of my main app. |
My advice for you is to start with quickstart or/and Spring demo. I'm sorry but I cannot help you with more information. |
I have the project in GitLab, could i share with you? and then you can test it and see what things are wrong or not compatible? the main app is Spring boot (last version) |
OK. Please share the project maybe I have some time to take a look. |
Could you give me permissions to push a new branch (issue/37) , i have cloned this: |
I did a push to master. For running the test:
I hope this can help. |
@Vikcen What is the status of this issue? Can we close it? |
Hello, i hope i can get some help.
I have tested successfully in my Spring Boot web application, loading plugins and getting my extensions from the plugin packaged in a jar like in your documentation shows in this way:
But i don't see any example of loading this plugin via @Autowired (in Spring Boot) like you say in the documentation:
I don't understand very well what you mean exactly with
Autowired
, Do you mean i could load the plugin in this way as attribute of a class in a Spring Boot context?Where Converter zipToPdfConversion is implemented in the same form of your documentation:
Can you show me some example to see how to do that Autowired of a plugin class (extending SpringPlugin) thru Spring Boot?
The idea is to load the plugin without package the plugin in a jar, i have just the plugin in the source code. I want the two ways, load from a jar and load without packaged in jar (is this possible?).
Thank you, greetings.
The text was updated successfully, but these errors were encountered: