Skip to content
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

[SUREFIRE-2240] Don't manage JUnit5 artifact versions #725

Merged
merged 1 commit into from Mar 7, 2024

Conversation

kwin
Copy link
Member

@kwin kwin commented Mar 5, 2024

This allows to more easily overwrite the version via plugin dependencies

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SUREFIRE-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace SUREFIRE-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its clean install).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

This allows to more easily overwrite the version via plugin dependencies
@@ -80,6 +80,13 @@
<tag>surefire-3.0.0-M8</tag>
</scm>

<properties>
<!-- common version suffix by platform and other junit5 artifacts, compare with https://github.com/junit-team/junit5/blob/main/gradle.properties -->
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcphilipp Is the assumption right that they always share the same suffix?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's correct but I'd feel more comfortable if this didn't have to be known here. Why didn't it work out with the BOM?

Copy link
Member Author

@kwin kwin Mar 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BOM will affect transitive dependencies of overridden plugin dependencies, and therefore leads to incompatible versions/prevents updating the engine

@rmannibucau
Copy link
Contributor

Thinking out loud: any reason to have junit in dependency at all? can't we just use ToolProvider "junit" to launch it and be totally decoupled from junit? Would enable to use the project dependencies and if some is missing (platform) just download it but without any compiling coupling nor need of the bom hell.

@marcphilipp
Copy link
Contributor

The used version needs to match the one in the project's dependencies, i.e. if a build uses JUnit Jupiter 5.10.2, Surefire should use 1.10.2 of its JUnit Platform dependencies. I don't see how a ToolProvider would solve that problem. Could you please elaborate?

@kwin
Copy link
Member Author

kwin commented Mar 7, 2024

@marcphilipp @rmannibucau Let us focus in this PR only on the issue that overriding plugin dependencies as outlined in https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html#api-engine-versions-segregation does not work.
Bigger refactoring (exclusing of JUnit Engine dependency) should be tackled separately.

@rmannibucau
Copy link
Contributor

@marcphilipp we wouldn't have any provided dependency in surefire itself, everything would be resolved from project dependencies (if provided use else resolve the aligned version) means there is no more bom topic or things like that with a hybrid surefire/project source of dependencies.

@kwin kwin merged commit 96128a5 into master Mar 7, 2024
38 checks passed
@kwin kwin deleted the bugfix/get-rid-of-junit5-dep-mgmt branch March 7, 2024 13:51
@marcphilipp
Copy link
Contributor

FWIWI Gradle recently went that route to no longer include/resolve junit-platform-launcher but require users to add it themselves: https://docs.gradle.org/current/userguide/upgrading_version_8.html#manually_declaring_dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants