Once after we build the jar will have the resource files under BOOT-INF/classes or target/classes folder, which is in classpath, use the below method and pass the file under the src/main/resources as method call getAbsolutePath("certs/uat_staging_private.ppk"), even we can place this method in Utility class and the calling Thread instance will be taken to load the ClassLoader to get the resource from class path.
public String getAbsolutePath(String fileName) throws IOException {
return Thread.currentThread().getContextClassLoader().getResource(fileName).getFile();
}
we can add the below tag to tag in pom.xml to include these resource files to build target/classes folder
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.ppk</include>
</includes>
</resource>
</resources>