Skip to content

Remove explicit JUnit 4 dependency declaration#1353

Open
strangelookingnerd wants to merge 1 commit intojenkinsci:masterfrom
strangelookingnerd:remove-junit4
Open

Remove explicit JUnit 4 dependency declaration#1353
strangelookingnerd wants to merge 1 commit intojenkinsci:masterfrom
strangelookingnerd:remove-junit4

Conversation

@strangelookingnerd
Copy link
Contributor

@strangelookingnerd strangelookingnerd commented Feb 9, 2026

Removes the explicit JUnit 4 dependency declaration.
It is still transitively pulled through junit-vintage-engine so there is no reason to declare it again.

This change could be considered breaking as consumers that have a hard dependency on junit:junit would likely fail to build (e.g. jenkinsci/xshell-plugin#260). Otherwise there should be no side-effects, meaning plugins that still use JUnit 4 (but don't declare it) are not affected.

I want to take this measure to push the JUnit Jupiter migration as discussed on the Contributor Summit 2026.

Testing done

Tested locally.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

<rules>
<RestrictImports>
<reason>Use JUnit 5 (org.junit.jupiter.*)</reason>
<reason>Use JUnit Jupiter (org.junit.jupiter.*)</reason>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the naming to be more consistent, since we are using JUnit 6.x by now.

@jglick
Copy link
Member

jglick commented Feb 9, 2026

It is still transitively pulled through junit-vintage-engine

Or org.jenkins-ci.main:jenkins-test-harness in an example I could tell. Or Testcontainers in another example.

What you are removing here is not an explicit dependency declaration as claimed; it is the dependencyManagement entry. Which I think ought to stay, so long as anything which is listed as an explicit dependency pulls it in transitively.

It is not clear to me what the actual purpose of this change is. -0 for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants