Maven配置插件跳过测试代码的编译和运行

时间:2022-05-25 01:24:06

Maven配置插件跳过测试代码的编译和运行:

                <!-- 编译插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<!-- 略过测试代码的编译,不推荐 -->
<skip>true</skip>
</configuration>
</plugin>
<!-- 单元测试插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- 略过整个单元测试的执行,不推荐 -->
<skip>true</skip>
</configuration>
</plugin>