【Spring问题】如何springboot打包过程中跳过mvn test

在eclipse每次使用run as -> maven install, 总是运行junit test,一些test还关联数据库, 有的比较危险。怎么跳过测试skip test呢?


首先确认是springboot的项目

<plugin>
  <groupId>org.springframework.bootgroupId>
  <artifactId>spring-boot-maven-pluginartifactId>
  <configuration>
    <finalName>***finalName>
    <mainClass>***mainClass>
  configuration>
  <executions>
    <execution>
      <goals>
        <goal>singlegoal>
      goals>
    execution>
  executions>
plugin>

然后在标签下的标签中加入true

比如下面

<properties>
    <project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8project.reporting.outputEncoding>
    <java.version>1.8java.version>
    <mysql.version>5.1.38mysql.version>
    ...
    <skipTests>trueskipTests>

     
    
    
properties>

注释的都是可替换的选择


你可能感兴趣的:(框架)