You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Rich M (Jira)" <ji...@apache.org> on 2021/06/25 18:09:00 UTC
[jira] [Created] (SUREFIRE-1920) After adding junit-platform-runner
dependency, Junit 5 test cases are ignored
Rich M created SUREFIRE-1920:
--------------------------------
Summary: After adding junit-platform-runner dependency, Junit 5 test cases are ignored
Key: SUREFIRE-1920
URL: https://issues.apache.org/jira/browse/SUREFIRE-1920
Project: Maven Surefire
Issue Type: Bug
Components: Maven Surefire Plugin
Affects Versions: 3.0.0-M5
Reporter: Rich M
I want to run Junit 4 and 5 test cases in same project. Some of the JUnit5 test cases also have @RunWith(JUnitPlatform.class) annotation to run with Junit4.
To successfully compile class having above annotation, I would need to add "junit-platform-runner" dependency in pom.xml, but the moment I add it, Maven ignores JUnit 5 test cases.
I have tried various combinations but nothing seems to work. Note that if I remove the class having above annotation and remove "junit-platform-runner" dependency from pom, then Maven is able to run the remaining Junit 4 and 5 test cases successfully. Problem seems to be only with @RunWith(JUnitPlatform.class) annotation and "junit-platform-runner" dependency.
Note that when I use maven-surefire-plugin version 3.0.0-M4, then everything works fine. Seems to be a bug with 3.0.0-M5.
Source code - [https://github.com/niajthat/junit45]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)