Skip to content

JUnit Vintage Engine not added to test classpath if only part of maven-surefire-plugin's plugin classpath #2112

@kwin

Description

@kwin

In https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit.html there are several examples where the JUnit engine is given via the m-surefire-plugin's plugin classpath (i.e. via dependencies below plugin). However those are never added to Eclipse's test classpath, therefore executing JUnit4 tests with JUnit5 runner fails. Only Maven's test classpath is considered to populate Eclipse's test classpath (which notably does not include m-s-p's plugin classpath)

Compare also with eclipse-jdt/eclipse.jdt.ui#2713.

OTOH the Eclipse built-in JUnit5 library consists of the following engines:

  1. junit-platform-suite-engine_1.14.1.jar
  2. junit-vintage-engine_1.14.1.jar

In order to allow execution of JUnit4 and JUnit5 tests in the same Eclipse Test execution I would suggest to also add at least the engine dependencies (from the plugin's classpath) to the Eclipse test class path as well.

Metadata

Metadata

Assignees

Labels

testingRelated to JUnit/TestNG test execution in Eclipse

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions