When you run the mvn package command, as part of the build cycle, Maven will compile and test the code before packaging it in its distributable format.
However there are times when you want to compile and package the code without running the test. While I don’t advocate shipping untested code, there can be a number of reasons why you want to package the code without running test.
In order to perform mvn package without running the test. You need to use the argument -Dmaven.test.skip=true
So the command should look like the following
mvn package -Dmaven.test.skip=true