springspring-bootdynamic-class-loaders

Loading a external jars dynamically in a spring boot application @runtime


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.


Solution

  • @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