maven-2surefire

Is there a way to skip only a single test in maven?


I would like to skip only a single test while launching mvn install.

Is there a way to do that ?


Solution

  • With junit 4, I add an @Ignore annotation when I want to do that. This would work for you, unless you want to only sometimes ignore the test, or only ignore it when the build runs from maven. If this is the case, then I would ask "Why?"

    Tests should be consistent, they should be portable, and they should always pass. If a specific test is problematic I would consider re-writing it, removing it entirely, or moving it to a different test suite or project.