John
John

Reputation: 1601

How to run maven wrapper from docker?

I have to run a maven wrapper command from dockerfile but I don't know how can I do it? When I tried wrote like this:

RUN ./mvnw -s settings.xml clean install

this command not work. I have error mvnw: not found

my dockerfile:

FROM ubuntu
WORKDIR /app
COPY ./ ./

RUN ./mvnw -s .mvn/settings.xml -B -f /app/pom.xml dependency:resolve-plugins dependency:resolve dependency:go-offline

Upvotes: 3

Views: 4450

Answers (1)

John
John

Reputation: 1601

I find the way how to fix this issue. I had just added chnod +x ./mvnw command and final RUN command looks like this:

RUN chmod +x ./mvnw && \
./mvnw -s .mvn/settings.xml -B -f /app/pom.xml dependency:resolve-plugins dependency:resolve dependency:go-offline

Upvotes: 2

Related Questions