maven打包时跳过测试

运行mvn install时跳过Test

方法一:
<project>  
  [...]  
  <build>  
    <plugins>  
      <plugin>  
        <groupId>org.apache.maven.plugins</groupId>  
        <artifactId>maven-surefire-plugin</artifactId>  
        <version>2.18.1</version>  
        <configuration>  
          <skipTests>true</skipTests>  
        </configuration>  
      </plugin>  
    </plugins>  
  </build>  
  [...]  
</project>  
方法二:

mvn install -DskipTests
或者
mvn install -Dmaven.test.skip=true

详情参考:maven-surefire-plugin/examples/skipping-tests

    原文作者:DeFuture
    原文地址: https://www.jianshu.com/p/5818ff9fee99
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞