Build Failed
Project ID: {0609d9e9-c979-4a60-abc4-c954d2f050e5}
Trying to build my spring project with "mvn install" and I get : java.lang.IllegalArgumentException: Could not resolve placeholder 'jwt.secret' in value "${jwt.secret}"
I did add the variable in service Variables as jwt.secret and the value.
Solution:Jump to solution
if you need environment variables to be available during a dockerfile build you need to bring them in with
ARG <variable name>
14 Replies
Project ID:
0609d9e9-c979-4a60-abc4-c954d2f050e5
@aleks have any ideas?
it worked before,
tried to remove/add back the variable, doesn't help
before what?
few commits back
all the changes I add, have nothing with this JWToken instance
redeploy an old deployment from within your service
the diff is that it skipped Tests,
I updated Dockerfile to mvn install
and got this error for jwt.token
the q is why it doesn't see the variable in Variables
have you referenced the variables with
ARG
in your dockerfile?no
Solution
if you need environment variables to be available during a dockerfile build you need to bring them in with
ARG <variable name>
Build stage
FROM maven:3.6.3-openjdk-17 AS build
COPY application/src /home/app/src
COPY application/pom.xml /home/app
ARG jwt_secret
ENV jwt.secret=$jwt_secret
WORKDIR /home/app
RUN mvn install
will it work ?
probably not considering that's not the variable name you use in the service variables
this helped