-
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
Loading plugin as spring boot executable jar #48
Comments
Sure. |
Thank you for your answer. |
|
In spring boot application, the natural way to build a jar is just the
The |
Of course, I don't want to convince you to not use Other variant is what I said in my previous comment:
Any contribution (PR) is welcome. |
I have personally used pf4j in some of my projects with Spring Boot. I think what @decebals is saying about plugins not being executable makes complete sense. A plugin at the end of the day is a contract implementation. So they you can actually lay down some guidelines for the plugin developers on how it should be packaged. That is exactly what we did in our projects. I understand that using a .jar file is more native to Java and no extraction is required, but like we already know the Spring Boot executable is a complex beast in itself. |
I'm trying to understand what happens under the hood of the spring boot classloader. I agree with you, it's complex enough, but "we should try, not because it's easy but because it's hard" :) |
I've tested loading a plugin developed with spring boot.
Normally, a spring boot project (it could be the plugin) is built with
spring-boot-maven-plugin
that create a spring boot executable jar, that is a fat jar that contains classes + libs.The structure of a spring boot executable jar is different than a standard jar, look at this doc page: https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-executable-jar-format.html#executable-jar-jar-file-structure
So plugin classes (and extension.idx) are placed, into the jar, at this folder:
BOOT-INF/classes
.Is there a way for pf4j to search classes not in the root of jar but in a subfolder of it?
The text was updated successfully, but these errors were encountered: