You may want to configure Maven to skip the unit test completely. Maybe you have a large system. Unit Testing takes many minutes to complete, but you don't want to wait until the final output is generated. You may be working on a legacy system that has a series of failed unit tests. You may just want to generate a jarInstead of fixing all unit tests. Maven provides the ability to skip unit tests. You only need to use the surefire plug-inskip
Parameters. In the command line, you just need to addmaven.test.skip
Property to skip the test:
$ MVN install-dmaven. Test. Skip = true
...
[Info] [Compiler: testcompile]
[Info] Not compiling test sources
[Info] [surefire: Test]
[Info] tests are skipped.
...
When surefire plug-in arrivestest
Ifmaven.test.skip
Settrue
The unit test is skipped. Another way to configure Maven to skip unit test is for your projectpom.xml
Add this configuration. You need yourbuild
Addplugin
Element.
<Project>
[...]
<Build>
<Plugins>
<Plugin>
<Groupid> Org. Apache. Maven. plugins </Groupid>
<Artifactid> Maven-surefire-plugin </Artifactid>
<Configuration>
<Skip> True </Skip>
</Configuration>
</Plugin>
</Plugins>
</Build>
[...]
</Project>