Skip tests in Jenkins

前端 未结 4 1968
逝去的感伤
逝去的感伤 2021-02-05 04:15

I\'ve set up a build on Jenkins for a Maven project, and I would like to build it without running any of the tests. I\'ve tried entering \"clean install -DskipTests\" in the go

4条回答
  •  时光取名叫无心
    2021-02-05 04:54

    Just to extend the answer, maven has 2 options for skipping tests:

    -DskipTests=true — The one that was mentioned. With this parameter, maven ignores tests completely.

    -Dmaven.test.skip=true — With this option maven compiles the tests but doesn't launch them.

    So you may want to use the second option instead as fast code compile validation. E.G.: if you develop some library or module that will be used by some one else you must be sure that you don't brake contract with the client. Tests compilation can help you with this.

    Use either of these parameters depending on your needs.

提交回复
热议问题