Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between -DskipTests and -Dmaven.test.skip=true

Tags:

java

maven

hive

I was trying to build hive-0.13.

When using -Dmaven.test.skip=true, it will not build the test jars but it will check test dependency.

When using -DskipTests, it will not build the test jars and also not check test dependency.

What's the difference between -DskipTests and -Dmaven.test.skip=true?

like image 219
Stanley Shi Avatar asked Sep 03 '14 08:09

Stanley Shi


People also ask

What's the difference between single and double quotation marks?

General Usage Rules In America, Canada, Australia and New Zealand, the general rule is that double quotes are used to denote direct speech. Single quotes are used to enclose a quote within a quote, a quote within a headline, or a title within a quote.

What is the difference between single and double inverted commas?

Double quotation marks (in British English) are used to indicate direct speech within direct speech (use single inverted commas for direct speech and double quotation marks to enclose quoted material within).

How do you use single quotation marks?

Single quotation marks are used to indicate quotations inside of other quotations. “Jessie said, 'Goodbye,'” Ben said. This is Ben talking, so his words go in quotation marks. But because we're quoting Ben quoting someone else, Jessie, we use single quotation marks to indicate the quote within the quote.

What's the difference between apostrophe and quotation marks?

They are two entirely different punctuation symbols. Single quotes are limited to one real function in written U.S. English, which is to indicate a quotation within a quotation. Apostrophes, on the other hand, are used to denote possessive form and to indicate omission.


2 Answers

Maven docs:

-DskipTests compiles the tests, but skips running them

-Dmaven.test.skip=true skips compiling the tests and does not run them

Also this one might be important

maven.test.skip is honored by Surefire, Failsafe and the Compiler Plugin

like image 126
Kamil Kłys Avatar answered Oct 01 '22 09:10

Kamil Kłys


There is a third, related option described here: https://stackoverflow.com/a/21933970/3169948

"maven.test.skip.exec=true" the tests get compiled, but not executed.

So the complete set of test options for Maven would be:

  • -DskipTests ==> the tests get compiled, but not executed.
  • -Dmaven.test.skip.exec=true ==> the tests get compiled, but not executed (exactly the same as -DskipTests).
  • -Dmaven.test.skip=true ==> doesn't compile or execute the tests.
like image 45
CorbaTheGeek Avatar answered Oct 01 '22 10:10

CorbaTheGeek