We have a spring boot application which is referring to a 3rd party jar . The 3rd party jar is having all getters and setters . But this external JAR keeps changing periodically . This external jar is places in shared location . Is there a way by which spring boot application will be made aware of new verion of external jar whenever its gets changed and spring boot should dynamically load the new external jar programmatically.
Asked
Active
Viewed 7,636 times
2 Answers
1
@Sat....try this one credit goes to....
Dynamically add jars to SpringBoot at runtime
java -cp my-jar.jar -Dloader.path=external-jar.jar -Dloader.main=com.my.Application org.springframework.boot.loader.PropertiesLauncher

kumar
- 497
- 4
- 12
-
1Is the spring-boot jar is going to automatically know whenever the external jar gets changed . – Sat Oct 22 '18 at 11:26
0
I don't believe you can load a jar more than once. We had a similar use case when we were using JNI and had to load DLLs. The problem you will run into is you need the garbage collector to clean up references to the old library.
Long story short, avoid doing this at all costs. There are better paradigms

user489041
- 27,916
- 55
- 135
- 204