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

Fix missing junit-platform-launcher version #4588

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DidierLoiseau
Copy link
Contributor

What's changed?

Use the JUnit BOM to specify the version of all JUnit dependencies.

Since rewrite-test uses JUnit as an api() dependency, this is done through api(platform(…)) instead of testImplementation(platform(…)).

What's your motivation?

I tried to build OpenRewrite on my Linux Desktop machine, and I kept getting the following error:

> Task :rewrite-java-17:compatibilityTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':rewrite-java-17:compatibilityTest'.
> Could not resolve all files for configuration ':rewrite-java-17:compatibilityTestRuntimeClasspath'.
   > Could not find org.junit.platform:junit-platform-launcher:.
     Required by:
         project :rewrite-java-17

(also with the other rewrite-java-* modules)

I don’t really understand why it works in other environments, but the thing is that the junit-platform-launcher version wasn’t specified anywhere.

JUnit documentation suggests using their BOM to align dependency versions. I thought it couldn’t hurt anyway, and this allows centralizing the version of JUnit (though I kept latest.release for now)

Anything in particular you'd like reviewers to focus on?

I am not very familiar with Gradle so better double check this 🙂

Have you considered any alternatives or workarounds?

This is the only solution I found but maybe I should have posted a question as well 😏

Checklist

  • I've added unit tests to cover both positive and negative cases – N/A
  • I've read and applied the recipe conventions and best practices – N/A
  • I've used the IntelliJ IDEA auto-formatter on affected files – actually I get different formatting if I do that on rewrite-java-8/build.gradle.kts

@DidierLoiseau DidierLoiseau force-pushed the fix/gradle-build-junit-platform-launcher branch from 34e256a to 7eb5ece Compare October 18, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant