Maven skip tests

后端 未结 8 2155
攒了一身酷
攒了一身酷 2020-12-12 09:10

I am using Maven 2.2.1 and to build my project I used this command

mvn clean install -Dmaven.test.skip=true

However, the build failed sayin

8条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-12 10:01

    There is a difference between each parameter.

    • The -DskipTests skip running tests phase, it means at the end of this process you will have your tests compiled.

    • The -Dmaven.test.skip=true skip compiling and running tests phase.

    As the parameter -Dmaven.test.skip=true skip compiling you don't have the tests artifact.

    For more information just read the surfire documentation: http://maven.apache.org/plugins-archives/maven-surefire-plugin-2.12.4/examples/skipping-test.html

提交回复
热议问题