-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
maven-surefire manages transitive dependency of junit-platform-engine to version 1.9.3 which conflicts with junit-jupiter-engine 5.10.2 #3714
Comments
I created https://issues.apache.org/jira/browse/SUREFIRE-2240 to track the issue upstream. |
Does adding the JUnit 5.10.2 BOM to the build dependencies help? |
@marcphilipp As said before
|
Instead of using plugin dependencies, could the engine be declared in |
I don’t want to have classes in the test compile classpath which I don’t call in my tests… |
Makes sense to me. While that doesn't help you, Gradle has a Closing this issue as Maven's dependency management is the root cause of this problem and, as far as I'm aware, there's nothing we can do in JUnit to avoid this situation. |
Steps to reproduce
The JUnit 5 BOM for version 5.10.2 manages version 1.10.2 of
junit-platform-engine
.However the JUnit BOM used in
maven-surefire-plugin
(even of the most recent 3.2.5) is 5.9.3 (https://github.com/apache/maven-surefire/blob/2fed802397f8c7de4cfc72f49ab4565e72f7aab7/pom.xml#L315), using version 1.9.3 ofjunit-platform-engine
.When now explicitly upgrading the
junit-jupiter-engine
version used bymaven-surefire-plugin
viawith just having
junit-jupiter-api:5.10.2
in the test classpath the following error is emittedThis is due to the following classpath being used by
maven-surefire-plugin
:Importing the JUnit 5 BOM in
dependencyManagement
does not help, becausedependencyManagement
does not apply to plugin dependencies (https://issues.apache.org/jira/browse/MNG-2496).Workaround:
Use
as that forces
maven-surefire-plugin
to reuse the version 1.10.2 ofjunit-platform-engine
from the test classpath instead of using 1.9.3.This is probably a regression of https://issues.apache.org/jira/browse/SUREFIRE-2177 and requires a fix in Maven, but having this as reference here might help other users.
Context
The text was updated successfully, but these errors were encountered: