Use bundled Jupiter version for JUnit platform console standalone JARs#2960
Conversation
db84f2a to
e4780e7
Compare
|
This patch intentionally handles the known JUnit Platform Console Standalone layout, |
|
@trancexpress please help review this PR. |
|
@wenytang-ms : to be clear, are you using latest 4.40 nightly build or are you using some older released Eclipse version? Latest nightly build is here: https://download.eclipse.org/eclipse/downloads/drops4/I20260426-1800/. |
@iloveeclipse yes, I can repro such issue. |
|
@wenytang-ms the PR looks great, please remove the merge commits and squash the remaining commits. Please also reword the commit message to reflect the current fix. I tried to do this, but when setting the PR you've disabled editing by committers: If you have future PRs, please amend and rebase for small changes like this. Generally only project branches have multiple commits. Normal PRs generally have 1 commit for the change and maybe the bot-generated bundle version bumps. |
08ead52 to
2e369cc
Compare
@trancexpress done |
|
@wenytang-ms commit message is still outdated. |
2e369cc to
0d12702
Compare
JUnit Platform Console Standalone jars expose the platform version in Specification-Version, while the bundled Jupiter engine version is stored in Engine-Version-junit-jupiter. Prefer that Jupiter engine version for junit-platform-console-standalone jars so JUnit 5 and JUnit 6 detection uses the version of the test engine rather than the platform artifact. Fall back to Specification-Version for the existing non-standalone cases and leave annotation lookup/access restriction behavior unchanged. Fixes: eclipse-jdt#2959
0d12702 to
1ef01cb
Compare
@trancexpress done |
|
Thank you for the report and fix @wenytang-ms ! |


Summary
Fix JUnit 5/6 detection for
junit-platform-console-standaloneJARs whose manifest exposes different Platform and Jupiter engine versions.Problem
junit-platform-console-standalone-1.13.4.jarcontains JUnit Jupiter 5.13.4, but its manifestSpecification-Versionrepresents the JUnit Platform version (1.13.4), not the bundled Jupiter engine version.CoreTestSearchEngine.hasJUnit5TestAnnotation()uses the resolved annotation type to inspect the containing JAR version. For standalone console JARs, readingSpecification-Versioncauses the detected major version to be1, so the JAR is not recognized as JUnit 5.This can prevent a plain Eclipse Java project using
junit-platform-console-standalone-1.13.4.jarfrom launching JUnit 5 tests correctly.Fix
When the containing JAR is
junit-platform-console-standalone-*, prefer the manifest attribute:and fall back to:
for the existing non-standalone cases.
This keeps the existing annotation lookup and access-restriction behavior unchanged.
Behavior Matrix
junit-jupiter-api-*.jaron classpathjunit-platform-console-standalone-1.13.4.jarwith Jupiter 5.13.41.x, not JUnit 5junit-platform-console-standalone-6.0.3.jarTests
Added
JUnitStandaloneDetectionTestcovering:junit-platform-console-standalone-1.13.4.jar:Specification-Version=1.13.4,Engine-Version-junit-jupiter=5.13.4junit-platform-console-standalone-6.0.3.jar:Specification-Version=6.0.3,Engine-Version-junit-jupiter=6.0.3Related