I am facing problem in running a spring boot jar file with external profile.
I have a spring boot project with jersey. I have placed the properties and some certificate file in different directories (for different servers development and production etc). The application needs these properties and certificate files.
My project structure looks like
MyProject
|_configurations
|_local
|_dev
|_web
|__src
|_target
I can run it locally on intelliJ by by setting the local profile in class path. I am generating the jar file out of the web directory.
When I run the jar file it complains and can not find the properties and certificate files.
These are my attempts
- Generate a new jar file by placing the required properties and certificates in resource directory under web\src\main directory.
- Putting the properties file in class path while running the jar file as
java –jar –DApp.config.file="c:\MyProject\conf\local" MyProject.jar
But nothing works and i get the same error, complaining that properties and certificate files could not be found.
Any help how this can be solved. Is there any other better solution to solve this kind of problem.