Skip to content

fix: stop JUnit 5 leak from junit6 modules#2244

Merged
caalador merged 1 commit into
mainfrom
issues/2219-junit6_module_leaks_junit5_engine
May 15, 2026
Merged

fix: stop JUnit 5 leak from junit6 modules#2244
caalador merged 1 commit into
mainfrom
issues/2219-junit6_module_leaks_junit5_engine

Conversation

@mcollovati
Copy link
Copy Markdown
Contributor

The vaadin-testbench-core-junit6 and vaadin-testbench-unit-junit6 modules were empty wrappers depending on their JUnit 5 siblings. Their published POMs therefore advertised junit-platform-engine:1.14.0 and the rest of the JUnit 5 line as transitive dependencies. Consumers building against junit-bom:6.x ended up with a mixed graph where junit-platform-engine:1.14.0 could win Maven's nearest-wins resolution, causing NoClassDefFoundError at test runtime.

Rework both modules to share source with their JUnit 5 sibling via build-helper-maven-plugin instead of depending on it, mirroring the pattern already used by vaadin-testbench-integration-tests-junit6. Each module now imports junit-bom, declares its own JUnit dependencies, and compiles the shared sources, so the published artifacts contain classes and expose only JUnit 6 transitives.

Fixes #2219

The `vaadin-testbench-core-junit6` and `vaadin-testbench-unit-junit6`
modules were empty wrappers depending on their JUnit 5 siblings. Their
published POMs therefore advertised `junit-platform-engine:1.14.0` and
the rest of the JUnit 5 line as transitive dependencies. Consumers
building against `junit-bom:6.x` ended up with a mixed graph where
`junit-platform-engine:1.14.0` could win Maven's nearest-wins
resolution, causing `NoClassDefFoundError` at test runtime.

Rework both modules to share source with their JUnit 5 sibling via
`build-helper-maven-plugin` instead of depending on it, mirroring the
pattern already used by `vaadin-testbench-integration-tests-junit6`.
Each module now imports `junit-bom`, declares its own JUnit
dependencies, and compiles the shared sources, so the published
artifacts contain classes and expose only JUnit 6 transitives.

Fixes #2219
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

Test Results

83 tests   80 ✅  8m 37s ⏱️
11 suites   3 💤
11 files     0 ❌

Results for commit c20c372.

♻️ This comment has been updated with latest results.

@caalador caalador merged commit 79692f8 into main May 15, 2026
18 of 20 checks passed
@caalador caalador deleted the issues/2219-junit6_module_leaks_junit5_engine branch May 15, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PiT 25.2: JUnit Platform version conflict between testbench-core-junit5 and JUnit 6

2 participants