maven打包时跳过测试

运行mvn install时跳过Test

 

方法一:

  1. <project>  
  2.   [...]  
  3.   <build>  
  4.     <plugins>  
  5.       <plugin>  
  6.         <groupId>org.apache.maven.plugins</groupId>  
  7.         <artifactId>maven-surefire-plugin</artifactId>  
  8.         <version>2.18.1</version>  
  9.         <configuration>  
  10.           <skipTests>true</skipTests>  
  11.         </configuration>  
  12.       </plugin>  
  13.     </plugins>  
  14.   </build>  
  15.   [...]  
  16. </project>  


方法二:

mvn install -DskipTests

或者

mvn install -Dmaven.test.skip=true

 

详情参考:http://maven.apache.org/surefire/maven-surefire-plugin/examples/skipping-test.html

posted @ 2018-05-15 18:11  星朝  阅读(300)  评论(0编辑  收藏  举报