Skip to content

Commit aa7d3eb

Browse files
committed
Document minimum required version of Maven Surefire
1 parent 24d0160 commit aa7d3eb

File tree

4 files changed

+10
-45
lines changed

4 files changed

+10
-45
lines changed

documentation/src/docs/asciidoc/release-notes/release-notes-6.0.0-M1.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ repository on GitHub.
4747
`--h` (rather than `-h`) or `-help` (rather than `--help`).
4848
* The `junit-platform-runner` module that provided the `JUnitPlatform` runner has been
4949
discontinued.
50+
* Support for Maven Surefire/Failsafe versions < 3.0.0 has been dropped.
5051
* The following deprecated APIs have been removed:
5152
- `ReflectionSupport.loadClass(String)` method
5253
- `ReflectionUtils.readFieldValue(...)` methods

documentation/src/docs/asciidoc/user-guide/running-tests.adoc

+2-20
Original file line numberDiff line numberDiff line change
@@ -318,27 +318,9 @@ for executing tests on the JUnit Platform. The `pom.xml` file in the
318318
and can serve as a starting point for configuring your Maven build.
319319

320320
[WARNING]
321-
.Use recent version of Maven Surefire/Failsafe to avoid interoperability issues
321+
.Minimum required version of Maven Surefire/Failsafe
322322
====
323-
To avoid interoperability issues, it is recommended to use a recent version of Maven
324-
Surefire/Failsafe (3.0.0 or later) because it automatically aligns the version of the
325-
JUnit Platform Launcher that is used with the JUnit Platform version found on the test
326-
runtime classpath.
327-
328-
If you are using a version older than 3.0.0-M4, you can work around the missing alignment
329-
by adding a test dependency on the matching version of the JUnit Platform Launcher to your
330-
Maven build as follows.
331-
332-
[source,xml]
333-
[subs=attributes+]
334-
----
335-
<dependency>
336-
<groupId>org.junit.platform</groupId>
337-
<artifactId>junit-platform-launcher</artifactId>
338-
<version>{version}</version>
339-
<scope>test</scope>
340-
</dependency>
341-
----
323+
As of JUnit 6.0, the minimum required version of Maven Surefire/Failsafe is 3.0.0.
342324
====
343325

344326
[[running-tests-build-maven-bom]]

platform-tooling-support-tests/projects/maven-surefire-compatibility/pom.xml

-13
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,4 @@
6767
</repository>
6868
</repositories>
6969

70-
<profiles>
71-
<profile>
72-
<id>manual-platform-dependency</id>
73-
<dependencies>
74-
<dependency>
75-
<groupId>org.junit.platform</groupId>
76-
<artifactId>junit-platform-launcher</artifactId>
77-
<scope>test</scope>
78-
</dependency>
79-
</dependencies>
80-
</profile>
81-
</profiles>
82-
8370
</project>

platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenSurefireCompatibilityTests.java

+7-12
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
import java.nio.file.Files;
1919
import java.nio.file.Path;
2020

21+
import org.junit.jupiter.api.Test;
2122
import org.junit.jupiter.api.io.TempDir;
22-
import org.junit.jupiter.params.ParameterizedTest;
23-
import org.junit.jupiter.params.provider.CsvSource;
2423
import org.junit.platform.tests.process.OutputFiles;
2524
import org.opentest4j.TestAbortedException;
2625

@@ -33,23 +32,19 @@
3332
*/
3433
class MavenSurefireCompatibilityTests {
3534

35+
static final String MINIMUM_SUPPORTED_SUREFIRE_VERSION = "3.0.0";
36+
3637
@ManagedResource
3738
LocalMavenRepo localMavenRepo;
3839

39-
@ParameterizedTest
40-
@CsvSource(delimiter = '|', nullValues = "<none>", textBlock = """
41-
2.22.2 | --activate-profiles=manual-platform-dependency
42-
3.0.0-M4 | <none>
43-
""")
44-
void testMavenSurefireCompatibilityProject(String surefireVersion, String extraArg, @TempDir Path workspace,
45-
@FilePrefix("maven") OutputFiles outputFiles) throws Exception {
46-
var extraArgs = extraArg == null ? new String[0] : new String[] { extraArg };
40+
@Test
41+
void testMavenSurefireCompatibilityProject(@TempDir Path workspace, @FilePrefix("maven") OutputFiles outputFiles)
42+
throws Exception {
4743
var result = ProcessStarters.maven(Helper.getJavaHome(17).orElseThrow(TestAbortedException::new)) //
4844
.workingDir(copyToWorkspace(Projects.MAVEN_SUREFIRE_COMPATIBILITY, workspace)) //
4945
.addArguments(localMavenRepo.toCliArgument(), "-Dmaven.repo=" + MavenRepo.dir()) //
50-
.addArguments("-Dsurefire.version=" + surefireVersion) //
46+
.addArguments("-Dsurefire.version=" + MINIMUM_SUPPORTED_SUREFIRE_VERSION) //
5147
.addArguments("--update-snapshots", "--batch-mode", "test") //
52-
.addArguments(extraArgs) //
5348
.redirectOutput(outputFiles) //
5449
.startAndWait();
5550

0 commit comments

Comments
 (0)