Skip to content
CodeKruPro

-DskipTests versus -Dmaven.test.skip=true

QuizMediumJava onlyAsked in: Accenture, Capgemini, Infosys, TCS, Wipro

What is the difference between mvn package -DskipTests and mvn package -Dmaven.test.skip=true?

  • -DskipTests compiles the test code but does not run it; -Dmaven.test.skip=true does not even compile the tests
  • They are identical
  • -DskipTests skips the main code compile
  • -Dmaven.test.skip=true runs only the failed tests

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in