Maven - Skip building test classes

后端 未结 5 1548
心在旅途
心在旅途 2021-01-30 19:36

Is there a simple way to not build the test classes?

mvn clean install -Dmaven.test.skip=true
5条回答
  •  不要未来只要你来
    2021-01-30 20:06

    Just to be explicitly clear:

    skipTests will compile anything in the , but will not execute them.

    maven.test.skip will NOT compile any tests, but WILL execute any compiled tests that made their way into the .

    So the behavior of the above 2 is opposite. Just wanted to point out that maven.test.skip doesn't skip compilation AND execution if test files are unpacked/copied/etc. into .

    Also, depending on which version of Maven your using, there's also maven.test.skip.exec=true which additionally skips test execution similar to skipTests.

提交回复
热议问题