Development record
I have a Maven project and I will clone the latest code. The Maven Package is about to be packaged, but an error is reported during the TEST phase. Confused, I decided to skip testing to package and deploy.
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
Skip Test when running MVN Install or MVN Package
Method 1: Modify the pOM.xml file
<project>
[...]
<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>
Method 2: Execute the command in Terminal
mvn install -DskipTests
Method 3: Execute the command in Terminal
mvn install -Dmaven.test.skip=true
Method 4: Use the Spring Boot project
The spring-boot-maven-plugin is already integrated with the maven-surefire-plugin, which automatically runs JUnit test
. You just need to add the following configuration to your pom.xml:
<properties>
<!-- Skip Test -->
<skipTests>true</skipTests>
</properties>
Read More:
- Could not find an NgModule. Use the skip-import option to skip importing in NgModule
- ERROR: Failed to Setup IP tables: Unable to enable SKIP DNAT rule
- [Solved] Failed to Setup IP tables: Unable to enable SKIP DNAT rule: (iptables failed: iptables –wait -t na…
- How to Solve Unzip Error: tar: Error is not recoverable: exiting now
- How to Fix xterm Xt error: Can’t open display: xterm: DISPLAY is not set
- Android: How to Start App Automatically
- Docker -v Directory Mount (How to Use)
- CentOS/RHEL 7: How to Reinstall GRUB2 from Rescue Mode (EFI)
- How to Use Apt get Command Under Mac OSX
- How to fix the ERROR: Failed to build gem native extension in Centos 8
- How to Solve Roscore Run error [Install ROS]
- Linux: How to Solve Rabbitmq Plug-in Install Error
- How to Uncompress 7z files on Ubuntu, Debian, Fedora
- Linux: How to Solve vim ~/.bashrc Execute Error
- How to Solve Mujoco Install Error in Ubuntu (Pycharm Run Error)
- How to Export All data in DataGridView to Local Excel
- How to Solve Ubuntu “Failed to fetch” Error
- Linux: How to Fix undefined reference to `itoa’
- Linux: How to Solve sudo operate Error