Gradle build without tests

后端 未结 13 1571
后悔当初
后悔当初 2020-12-12 08:41

I want to execute gradle build without executing the unit tests. I tried:

$ gradle -Dskip.tests build

That doesn\'t seem to

13条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-12 09:38

    Using -x test skip test execution but this also exclude test code compilation.

    gradle build -x test 
    

    In our case, we have a CI/CD process where one goal is compilation and next goal is testing (Build -> Test).

    So, for our first Build goal we wanted to ensure that the whole project compiles well. For this we have used:

    ./gradlew build testClasses -x test
    

    On the next goal we simply execute tests.

提交回复
热议问题