What's the difference between -DskipTests and

2019-01-31 07:24发布

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?

标签: java maven hive
2条回答
孤傲高冷的网名
2楼-- · 2019-01-31 07:37

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

查看更多
欢心
3楼-- · 2019-01-31 07:57

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 ==> compiles the tests, but skips running them
  • -Dmaven.test.skip.exec=true ==> the tests get compiled, but not executed.
  • -Dmaven.test.skip=true ==> doesn't compile or execute the tests.
查看更多
登录 后发表回答