2

We are trying to utilize pf4j and pf4j-spring to provide a flexible application based on Spring.

Ideally, we would like to define Spring beans (@Service, @Repository and others) in plugins and inject them in the main application.

From what I can see, it seems to fail due to timing issues. Or in other words, Springs expects the beans to be available before the PluginManager gets instantiated.

There is an example repository that illustrates the issue on GitHub.

The question would be: Can I change something, so that Spring instantiates the PluginManager first? Is there another approach to make this work?

Note: Yes, we are aware of sbp. Unfortunately, it seems to be dead, and we didn't get it working properly either.

incredibleholg
  • 583
  • 1
  • 7
  • 19
  • Despite I do not have an answer for you, I am interested in how are you expecting that your component scan search for the classes on the plugins that have the `@Component` and others annotations. Because the idea of plugins is to not enforce, for example, the package structure. – King Midas Mar 30 '22 at 08:18
  • hey @incredibleholg, I am the author of sbp, and I am not dead yet :) If you have any problem, welcome to post issue on github. – Hank Apr 27 '22 at 03:47

0 Answers0