Prevent unit tests but allow integration tests in Maven

前端 未结 7 839
無奈伤痛
無奈伤痛 2020-11-29 14:50

I\'ve a Maven build in which I use the SureFire plugin to run some unit tests, and the FailSafe plugin to run some integration tests. I would like a way to run just the Fai

7条回答
  •  天涯浪人
    2020-11-29 15:27

    A workaround would be to call:

    mvn clean test-compile failsafe:integration-test
    

    Admittedly, this is ugly, but it may solve your problem.


    Or (another hack):

    mvn clean integration-test -Dtest=SomePatternThatDoesntMatchAnything -DfailIfNoTests=false
    

    Reference:

    • surefire:test#test
    • surefire:test#failIfNoTests

提交回复
热议问题