[ https://issues.apache.org/jira/browse/SUREFIRE-1266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15420268#comment-15420268 ]
Tibor Digana edited comment on SUREFIRE-1266 at 8/14/16 9:48 AM: ----------------------------------------------------------------- [~afloom] You can open PR in github, but the solution proposal should be IF _testClassesDirectory_ does not exist or is empty AND _other-classpath_ is empty THEN skip plugin. The _other-classpath_ is integesting, see this http://maven.apache.org/surefire/maven-surefire-plugin/examples/configuring-classpath.html See _AbstractSurefireMojo.java_ but I am not sure if this is so easy to do. In can of _m-failsafe-p_ skipping the plugin should be preceded by cleanup of report; otherwise the verify phase would run using old reports. was (Author: tibor17): [~afloom] You can open PR in github, but the solution proposal should be IF _testClassesDirectory_ does not exist or is empty AND _other-classpath_ is empty THEN skip plugin. The _other-classpath_ is integesting, see this http://maven.apache.org/surefire/maven-surefire-plugin/examples/configuring-classpath.html See _AbstractSurefireMojo.java_ but I am not sure if this is so easy to do. > Specifying groups shouldn't require junit on classpath if no test classes > ------------------------------------------------------------------------- > > Key: SUREFIRE-1266 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1266 > Project: Maven Surefire > Issue Type: Improvement > Affects Versions: 2.19.1 > Environment: Windows 7, Oracle JDK 1.8.0_40, Maven 3.3.3 > Reporter: Anders Hammar > > Test framework: junit 4.8+ > I have a scenario where we want to configure the groups parameter in a parent > so that it doesn't have to be specified in all modules. However, not all > modules have test classes and therefore no dependency on junit is specified > in those projects. What then happens is that m-surefire-p fails with: > {quote} > groups/excludedGroups require TestNG or JUnit48+ on project test classpath > {quote} > This can be worked around by specifying skipTests on those projects, but it's > a bit cumbersome. > It would be nice if surefire could detect that there are no test classes > (src/test/main is empty) and therefore the project should just be ignored. > However, I guess there could be test classes in a dependency so that might > not be as easy. > Possibly the solution could be to not fail the surefire execution if > groups/excludedGroups is set but TestNG or JUnit 4.8+ is not on the > classpath, but issue a warning message and ignoring it? -- This message was sent by Atlassian JIRA (v6.3.4#6332)