maven中跳過單元測試 單元測試工具
Maven 提供了跳過單元測試的能力,只需要使用 Surefire 插件的 skip 參數。 在命令行,只要簡單的給任何目標添加 maven.test.skip 屬性就能跳過測試:
$ mvn install -Dmaven.test.skip=true
...
[INFO] [compiler:testCompile]
[INFO] Not compiling test sources
[INFO] [surefire:test]
[INFO] Tests are skipped.
...
當 Surefire 插件到達 test 目標的時候,如果 maven.test.skip 設置為 true ,它就會跳過單元測試。 另一種配置 Maven 跳過單元測試的方法是給你項目的 pom.xml 添加這個配置。 你需要為你的 build 添加 plugin 元素。
[...]
[...]
延伸閱讀
文章來源于領測軟件測試網 http://www.kjueaiud.com/