Junit4 and TestNG in one project with Maven
问题 To run them together there are few options available but I have chosen using different profiles for Junit and TestNG. But now problem is with excluding and including test cases. Since if we add testNG dependency to main project in maven it will skip all Junit,I have decided to put it in separate profile. So I am excluding TestNG tests in default(main) profile from compiling using following entry in pom.xml : <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler