[ https://issues.apache.org/jira/browse/SUREFIRE-1813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17173520#comment-17173520 ]
Tibor Digana commented on SUREFIRE-1813: ---------------------------------------- [~nils91] [~Thihup] I have got it working only by removing 4 dependencies. The problem was that you specified 3 kinds of activating JUnit5 and you have mixed up the junit5 runners with the junit4 runner {{junit-platform-runner}}. If you specify the runner {{junit-platform-runner}} withou the annotation RunWith(...) then of course nothing would run. In your case as you use the Jupiter annotations only i would recommend using only one dependency with M5: {code:xml} <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <version>${junit.jupiter.version}</version> <scope>test</scope> </dependency> {code} All the possibilities are mentioned in the documentation, please read it completely https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html#JUnit_Runner > Version 3.0.0-M5 fails to find Junit tests, while 3.0.0-M4 finds and runs it > ---------------------------------------------------------------------------- > > Key: SUREFIRE-1813 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1813 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin > Affects Versions: 3.0.0-M5 > Environment: Windows 10 Pro > Maven 3.6.3 > OpenJDK 12 > Reporter: Nils Dralle > Assignee: Tibor Digana > Priority: Major > Attachments: SF300M4-M5.zip, log.diff, m4.log, m5.log > > > Maven Surefire Plugin Version 3.0.0-M5 fails to find and run JUnit 5 tests, > while 3.0.0-M4 seems to do it fine. All things other than the plugin version > are equal. > Output with 3.0.0-M5: > {code:java} > [INFO] Scanning for projects... > [INFO] > [INFO] ----------------------------< de.test:test > >---------------------------- > [INFO] Building SF300M5 0.0.1 > [INFO] --------------------------------[ jar > ]--------------------------------- > [INFO] > [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test --- > [INFO] Deleting D:\testing\maven\surefire\SF300M5\target > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > D:\testing\maven\surefire\SF300M5\src\main\resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ test --- > [INFO] No sources to compile > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > test --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > D:\testing\maven\surefire\SF300M5\src\test\resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ > test --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > D:\testing\maven\surefire\SF300M5\target\test-classes > [INFO] > [INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ test --- > [INFO] > [INFO] ------------------------------------------------------- > [INFO] T E S T S > [INFO] ------------------------------------------------------- > [INFO] > [INFO] Results: > [INFO] > [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 > [INFO] > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 2.338 s > [INFO] Finished at: 2020-06-28T11:08:38+02:00 > [INFO] > ------------------------------------------------------------------------ > {code} > Output with 3.0.0-M4: > {code:java} > [INFO] Scanning for projects... > [INFO] > [INFO] ----------------------------< de.test:test > >---------------------------- > [INFO] Building SF300M4 0.0.1 > [INFO] --------------------------------[ jar > ]--------------------------------- > [INFO] > [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test --- > [INFO] Deleting D:\testing\maven\surefire\SF300M4\target > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > D:\testing\maven\surefire\SF300M4\src\main\resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ test --- > [INFO] No sources to compile > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > test --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > D:\testing\maven\surefire\SF300M4\src\test\resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ > test --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > D:\testing\maven\surefire\SF300M4\target\test-classes > [INFO] > [INFO] --- maven-surefire-plugin:3.0.0-M4:test (default-test) @ test --- > [INFO] > [INFO] ------------------------------------------------------- > [INFO] T E S T S > [INFO] ------------------------------------------------------- > [INFO] Running SFTests > [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.026 > s - in SFTests > [INFO] > [INFO] Results: > [INFO] > [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 > [INFO] > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 2.832 s > [INFO] Finished at: 2020-06-28T11:10:34+02:00 > [INFO] > ------------------------------------------------------------------------ > {code} > I´ve attached minimal test projects with both plugin versions. Everything > except the plugin version in the pom files should be the same. > -- This message was sent by Atlassian Jira (v8.3.4#803005)