Skip to content

Set JUnit 6 container if pom has JUnit 6 dependencies #2102

@trancexpress

Description

@trancexpress

See: eclipse-jdt/eclipse.jdt.ui#2695

We have a .classpath pointing to a JUnit 5 container, but pom.xml pointing to JUnit 6.

This worked up until Eclipse 4.37, with JUnit 6 support in Eclipse 4.38 it no longer works.

I see at least this mention of JUnit 5:

➜  m2e-core git:(main) ✗ git grep org.eclipse.jdt.junit.loader.junit5
org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenRuntimeClasspathProvider.java:  private static final String TESTKIND_ORG_ECLIPSE_JDT_JUNIT_LOADER_JUNIT5 = "org.eclipse.jdt.junit.loader.junit5"; //$NO
N-NLS-1$

Likely there are other places too, that need an update. In all likelihood, the code will need to differentiate between JUnit 5 and 6 in the pom and create a respective .classpath, when a JDT project is being created. No idea if synchronization is also needed, when the user changes the pom in Eclipse, resp. when a project is refreshed and changes are detected.

Metadata

Metadata

Assignees

No one assigned

    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