3

I am in my Maven based Java project. I want to skip the tests when building the Java project.

Currently, I have the following Docker instructions

RUN ["mvn", "clean"]
RUN ["mvn", "install"]

How do I skip the tests in the "install" instruction?
I tried putting -Dmaven.test.skip=true but didn't work.

VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755
Katlock
  • 1,046
  • 14
  • 34

1 Answers1

2

I tried putting -Dmaven.test.skip=true but didn't work

It depends how you put it. I would try:

RUN ["mvn", "install", "-Dmaven.test.skip=true"]

Although, do read "Maven skip tests" or "Maven packaging without test (skip tests)".

Community
  • 1
  • 1
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755