环境:Springboot2.x,配置如下
<maven.test.skip>true</maven.test.skip>跳过测试且不会生成class
<skipTests>true</skipTests>会跳过测试但是会生成测试class
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<dependencies>
<!-- spring热部署 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.8.RELEASE</version>
</dependency>
</dependencies>
<configuration>
<!--默认关掉单元测试 -->
<!-- <maven.test.skip>true</maven.test.skip> -->
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
<maven.test.skip>true</maven.test.skip>跳过测试且不会生成class
<skipTests>true</skipTests>会跳过测试但是会生成测试class
spring-boot-maven-plugin插件已经集成了maven-surefire-plugin插件,会自动运行 Junit test,因此停用自动单元测试,只需要调用<skipTests>true</skipTests>或者<maven.test.skip>true</maven.test.skip>即可
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<dependencies>
<!-- spring热部署 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.8.RELEASE</version>
</dependency>
</dependencies>
<configuration>
<!--默认关掉单元测试 -->
<!-- <maven.test.skip>true</maven.test.skip> -->
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。