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,262,500
  • 529
  • 4,410
  • 5,250
Katlock
  • 1,200
  • 1
  • 17
  • 41

1 Answers1

3

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,262,500
  • 529
  • 4,410
  • 5,250