Though I would encourage people to skip tests while building a project but sometimes its helpful to go down this path.
Skip Unit Test
To skip the entire unit test, uses argument “-Dmaven.test.skip=true“.
mvn install -Dmaven.test.skip=true mvn package -Dmaven.test.skip=true
Or define skipTests in maven-surefire-plugin.
pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
Now, build the project again, the entire unit tests will be ignored.