Skip tests in Jenkins

前端 未结 4 1951
逝去的感伤
逝去的感伤 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:50

    use "Goals and options" value is "clean install -DskipTests=true".

    it works like a Charm. I saved hours of time using this Option. :-)

    0 讨论(0)
  • 2021-02-05 04:53

    I use option "-DskipTests=true" in "Invoke top-level Maven target" -> "JVM Options" and it works fine.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-02-05 05:01

    The problem is that I omitted =true. I was able to build without running tests by entering:

    clean install -DskipTests=true
    
    0 讨论(0)
提交回复
热议问题