This happens me when I was trying to build without the integration tests only. My scenario was to skip only integration tests ,but it must execute the unit test cases. I gooooogle almost many links but no luck , but finally the luck clicks and it works for me with below pom.xml configuration.
Add the below tag into you pom.xml
Here you can use <exclude> tag and mentioned any test class you want to skip.If your java class name contains *ITest.java (i.e. MyMethodITest.java)
Not only integration test you can skip any classes over here, but you need to configure the pom.xml properly.And in the maven command you can use below command as normal (i.e. mvn clean install)
Note - Be careful about the version, because it may not work for all version.
I hope it will help you all.