Skip to content

Conversation

@strangelookingnerd
Copy link
Contributor

This change allows org.junit.platform.** imports. See #1178 for context.

I'd put it up for discussion if we want to include org.junit.vintage.** as well. However I think due to its nature it likely means that if JUnit Vintage is being used, so is JUnit4. That may render the whole rule kind of useless.

Note that this change also causes following output:

[INFO] [INFO] --- enforcer:3.6.1:enforce (check-junit-imports) @ ban-junit4-pass-it ---
[INFO] [WARNING] ruleName restrictImports with implementation org.apache.maven.plugins.enforcer.RestrictImportsuses the deprecated Maven Enforcer Plugin API. This will not be supported in a future version of the plugin. Please contact the rule maintainer to upgrade the rule implementation to the current API.
[INFO] [INFO] Rule 0: org.apache.maven.plugins.enforcer.RestrictImports passed

This seems to be already being taken care of in skuzzle/restrict-imports-enforcer-rule#248 and a future update may fix it.

Testing done

mvn clean verify -Dinvoker.test=ban-junit4-pass,ban-junit4-fail

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

@timja
Copy link
Member

timja commented Aug 15, 2025

Can we use the rc version which has the fix for the warning?

@strangelookingnerd
Copy link
Contributor Author

Can we use the rc version which has the fix for the warning?

Done in 8714835.
Works as expected.

@timja
Copy link
Member

timja commented Aug 15, 2025

I'd put it up for discussion if we want to include org.junit.vintage.** as well. However I think due to its nature it likely means that if JUnit Vintage is being used, so is JUnit4. That may render the whole rule kind of useless.

Just don't enable this rule if you want that as it would be pointless as you say.

@timja timja added the bug label Aug 15, 2025
@timja timja merged commit d468363 into jenkinsci:master Aug 15, 2025
2 checks passed
@strangelookingnerd strangelookingnerd deleted the allow_junit_platform branch August 15, 2025 12:40
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.

2 participants