I’ ve followed the tutorial on
containerize java application
And try to adat it to my need for a spring boot application I have, but when I run the build the command:
RUN --mount=type=bind,source=pom.xml,target=pom.xml \
--mount=type=cache,target=/root/.m2 \
./mvnw package -DskipTests && \
mv target/$(./mvnw help:evaluate -Dexpression=project.artifactId -q -DforceStdout)-$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout).jar target/app.jar
it complains saying that:
6.112 [INFO] ------------------------------------------------------------------------
6.112 [INFO] BUILD SUCCESS
6.112 [INFO] ------------------------------------------------------------------------
6.113 [INFO] Total time: 4.953 s
6.113 [INFO] Finished at: 2024-10-24T10:37:08Z
6.114 [INFO] ------------------------------------------------------------------------
8.715 mv: cannot stat 'target/ASSESSMENT_ONLINE_REST_SERVICE-1.5.2-SNAPSHOT.jar': No such file or directory
The build is done correctely and I know that the artifact ‘target/ASSESSMENT_ONLINE_REST_SERVICE-1.5.2-SNAPSHOT.jar’ has been stored in the target folder (I see if i run mvn clean install), now I’m asking:
why the command build do not see it? and this mv is for what?