Closed myohn-paypal closed 4 years ago
That is a good feature request. It will require classpath isolation though, not a very trivial problem to solve.
Yes, this issue is for allowing more dependencies to be easily added. Classloader isolation will be done in a separate issue / pull request.
So, you mentioned classpath isolation will be done in a separated PR. With the current changes you provided, what happens if there are two extensions installed, and they both use the same library, but in different versions? Wouldn't that cause a conflict?
With current changes: yup, there would be a conflict if the extension brought in a mismatched version of an existing dependency. It'd just be like placing inconsistent jars on the classpath. The first jar would win and the class would be loaded from there. There is a chance of linkage errors like NoSuchMethodError being thrown.
(In fact, I think butterfly itself has internally inconsistent dependencies. The build should be configured with maven dependency convergence rule or its gradle equivalent
The intent here with this pull request is that the extension can more easily add additional dependencies by dropping a single jar. The extension creator or butterfly deployer still has to be careful in ensuring consistent dependencies.
With classloader isolation later on, hopefully such problems can be reduced.
Ok, thanks.
Add support for loading butterfly extension jars that are packaged as spring-boot uber jar.
To make it easier for an extension to include its own transitive depdencies, change butterfly so that it can load extension jars that contain nested jars created by spring-boot maven plugin.