在具体项目,步骤需要跳过假设检验,应采取skipTests此属性设置为true.
<pre name="code" class="html"><project> [...] <!--http://blog.csdn.net/redstarofsleep--> <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
还能够通过maven.test.skip属性跳过測试的编译
mvn install -Dmaven.test.skip=true
假设希望在默认情况下跳过測试,可是运行命令的时候能够手动开启,那么在pom中要像以下这样配置:
<!--http://blog.csdn.net/redstarofsleep--> <project> [...] <properties> <skipTests>true</skipTests> </properties> [...] <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.18.1</version> <configuration> <skipTests>${skipTests}</skipTests> </configuration> </plugin> </plugins> </build> [...] </project>
然后在命令行运行的时候手动开启:
mvn install -DskipTests=false
详细的描写叙述请參照官方关至skip test叙述性说明: http://maven.apache.org/surefire/maven-surefire-plugin/examples/skipping-test.html
转载请注明出处:
http://blog.csdn.net/redstarofsleep
时间: 2024-10-12 12:49:41