I have a standard Sprinb Boot project.
And in the folder: src/main/resources/tmp/my_file.json, i have a json that I read in my Java code.
File file = new File("src/main/resources/tmp/my_file.json");
When running it locally it goes perfectly
With Jib I create a docker image:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<from>
<image>adoptopenjdk:11-jre-hotspot</image>
</from>
<to>
<image>xxx/my_project:${version}</image>
</to>
<container>
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
</container>
</configuration>
</plugin>
When I run the container, it gives me an error that it cannot find the file:
java.io.FileNotFoundException: src/main/resources/tmp/my_file.json (No such file or directory)
The "src/main/resources" folder is the standard location for static resources.
Should I add any extra configuration to Jib to make the file available?