SpringBoot external jar not load

柔情痞子 提交于 2021-02-10 06:33:34

问题


i have a java project with spring boot and I need to load application.properties and dependency jar from external folder.

I tested by using the application.properties in the classpath, and the loader.path property work correctly.

When I use external properties file (I'm sure they're used) the loader.path not work correctly and the result is ClassNotFound because the jars are not loaded.

Also when i launch the application with **-Dloader.path=**xxx it's work correctly.

How can I solve the problem using external properties and jar?


回答1:


Here is the document

  1. You need to make sure the load order of different property files.
  2. You need to make sure the loader.path points to the right path. I mean, relative path or absolute path? You'd better print it out.


来源:https://stackoverflow.com/questions/47649692/springboot-external-jar-not-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!