External library folder for Spring Boot

前端 未结 3 2172
-上瘾入骨i
-上瘾入骨i 2021-02-19 05:23

I wonder how to externalize all jdbc drivers for my Spring Boot applications, I would not like to insert jdbc drivers into my fat jar once the application is built.

Is t

3条回答
  •  一个人的身影
    2021-02-19 05:56

    CLASSPATH and -classpath will not be working in case of running Spring boot jar file. So there are below options are available:

    • Use -Dloader.path e.g. java -cp MyOwn.jar -Dloader.path=C:\Sandeep\lib -Dconsole.level=INFO -Dloader.main=abc.Main org.springframework.boot.loader.PropertiesLauncher --spring.config.name=application

    • Another option to place other jars into the JRE/lib/ext directory

    • Third option, open Spring Boot Jar with WinRAR application and add the jar file into the Spring Boot jar

提交回复
热议问题