0

Thanks in advance. When I run mvn clean install it runs all test cases in my src/test directory. In src/directory there are separate test directory for unit test and integration test. Please let me know if there is commandline option to ignore integration directory when I run mvn clean install.

I know I can do that by separating out integration and unit test or updating the pom.xml file.

I do not want to change any code, needs a solution with minimal changes.

dkakoti
  • 632
  • 9
  • 26
  • *there are separate test directory for unit test and integration test* what do you mean? Unit tests and integration tests already follow naming conventions, so there is already a distinction. What is the actual problem? What do you want to exclude, and what is your current config? – Tunaki Oct 20 '16 at 09:26
  • @Tunaki There is no naming convention followed. Inside src/test directory there is two directory unit and integration. When I run mvn test I want to exclude integration directory. I need mvn command line argument for that. – dkakoti Oct 20 '16 at 09:33
  • What I mean, there is a built-in convention that makes the distinction, so runinng unit tests will not run integration tests without having to exclude anything, [see this answer](http://stackoverflow.com/a/37999965/1743880). If you configured your POM to overrule that dinstinction, then just remove that and name your tests properly, no need to configure anything. – Tunaki Oct 20 '16 at 09:36
  • Yes, but convention is not used. so when I run mvn test, it is running both integration and unit test. Is there any way to exclude that directory without changing the code or pom.xml filre. – dkakoti Oct 20 '16 at 09:39
  • Refer to the linked question. See also http://stackoverflow.com/a/25911059/1743880 – Tunaki Oct 20 '16 at 09:51

0 Answers0