I want to make a standalone web application. I have some problems with SpringBoot.
My application is one jar file from SpringBoot.
But my application was usually needed jdbc driver jar. I want to exclude the jdbc driver jar for my application and read the library jar from the lib folder.
But SpringBoot lib folder is BOOT-INF/lib
is final static
. So, I want to add external classpath (lib) for the jdbc driver jar.
How to configure additional classpath in SpringBoot. Is it available?
You may refer this below link from spring boot:
https://docs.spring.io/spring-boot/docs/current/reference/html/executable-jar.html#executable-jar-property-launcher-features
In my case, it was needed " quote to find the external lib folder on windows platform
You can use the
loader.path
parameter to define a location for an external lib folder. All jars under this folder will be added to the classpath. For example, if you'd like to defineC:\extLib
as your external lib folder, you can do the following:For this to work, you need to use the PropertiesLauncher. There are two ways to do that:
Option 1
Update the project pom.xml and add the following tag:
Effective build tag, the post-update looks like below:
Option 2
Use the PropertiesLauncher when launching the application from the commandline:
References:
How to add jars to SpringBoot classpath with jarlauncher