Repository navigation
fix(examples): unblock JUnit 6 for the Java 11 examples - #1897
Merged
Merged
Conversation
The launcher was added to every Java example, including the ones that compile against a Java 11 toolchain and have no tests at all. JUnit 6 requires Java 17, so resolving its launcher for those projects fails and blocks the JUnit BOM upgrade. Declaring it only in the projects that use useJUnitPlatform() keeps the Java 11 examples building.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #1838.
Problem
examples/build.gradleaddedjunit-platform-launcherto every Java example.:lombokbuilds with a Java 11 toolchain, so Gradle resolves the launcher for JVM 11, and JUnit 6 only publishes variants for Java 17+::lombokand:aspectj:aspect(targetCompatibility = "11") have no tests, so they never needed the launcher.Change
jacoco/sub-aandjacoco/sub-b, the two examples that runuseJUnitPlatform(). TheintegrationTestsuite inaspectj/weavinggets its launcher fromJvmTestSuite; the other test tasks run JUnit 4.org.junit:junit-bomto 6.1.3 in/examples(the change from Bump org.junit:junit-bom from 5.13.4 to 6.1.3 in /examples #1838).The Java 11 examples stay. They are the only coverage for a consumer toolchain older than the JVM Gradle runs on.
Verification (local, Java 17)
:lombok:dependencies --configuration testRuntimeClasspathreports the launcher asFAILED.:lombok,:lombok:mapstruct,:lombok:sonarqubeand:aspectj:aspectresolves.cd examples && ./gradlew assemble check --continue→ BUILD SUCCESSFUL. JUnit Platform tests ran:jacoco:sub-a,jacoco:sub-b,aspectj:weaving:integrationTest, 0 failures.