1.命令行方式
跳过测试
1 mvn package -DskipTests
跳过编译和测试
1 mvn package -Dmaven.test.skip=true
2.pom.xml配置文件方式
1 <project> 2 [
]
3 <build> 4 <plugins> 5 <plugin> 6 <groupId>org.apache.maven.plugins
</groupId> 7 <artifactId>maven-surefire-plugin
</artifactId> 8 <version>2.4.2
</version> 9 <configuration>10 <skipTests>true
</skipTests>11 </configuration>12 </plugin>13 </plugins>14 </build>15 [
]
16 </project>17