I have a simple Java backend build with Maven. When I create .jar file with mvn clean install
, I can run it and everything works fine.
However, when I deploy it to Docker, the server runs, but when I make a GET call, the backend doesn't see static .png file located in src/main/resousces/
.
java.io.FileNotFoundException: /src/main/resources/logo.png (No such file or directory)
The image is uploaded to docker with this .gitlab-ci.yml
file:
services:
- docker:dind
before_script:
- docker info
maven-build:
stage: build
tags:
- maven3-jdk11
except:
- tags
script:
- mvn deploy -B -U
maven-release:
stage: deploy
tags:
- maven3-jdk11
only:
- tags
script:
- mvn deploy -B -Prelease-profile -Dmaven.javadoc.failOnError=false
(This is my first time working with Maven and Docker, so if the information I provided is not sufficient, please leave a comment.)