What is the easiest way to build spring boot jar file without its dependencies? Basically I should be able to keep dependency jar files in a separate folder.
Currently I'm using spring boot maven plugin, however, it creates a Fat jar file with all dependencies.
Below is a solution I found on How to Create an Executable JAR with Maven, You just need to put these in your plugins.
Just do not use
spring-boot-maven-plugin
at all and use JAR packaging. This way the build wouldn't package dependencies into the JAR.spring-boot-maven-plugin has option for repackaging that puts dependencies inside (making uber jar)
You can disable repackaging or make repackaged .jar go with other classifier [2]
http://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins-maven-plugin.html
http://docs.spring.io/spring-boot/docs/current/maven-plugin/examples/repackage-classifier.html
Replace change your build entry in pom.xml to
In the target folder there will be a dependency_jar folder with all the dependency jars, along with "project_name.jar"(fat jar) and "project_name.jar.original"(jar file of your code)