2

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?

  • you can refer to [Launching Executable Jars](https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#executable-jar-launching) for detail – neo Dec 05 '17 at 09:20
  • can you post your `main` method and how you start your application with external properties – Jaiwo99 Dec 05 '17 at 09:24

1 Answers1

0

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.
Bejond
  • 1,188
  • 1
  • 11
  • 18