'Unable to load p12 file in application.properties

I have a multi-module Spring Boot 1.5.9 application with two modules.

Module A has a /certs folder that contains a p12 file.

Module A application.properties ref this file in the following way.

property=file:./certs/file.p12

Module B has a class that uses this p12 file for configuration.

 props.put(KEYSTORE_LOCATION, "./certs/file.p12");

When Module B class try load this file using the path specified in application.properties of another module. It throws the following exception:

Caused by: java.io.FileNotFoundException:./certs/file.p12 (No such file or directory)

What is the right approach to solve it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source