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

[SUREFIRE-2245] Upgrade to Parent 42 and Maven 3.6.3 #737

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

michael-o
Copy link
Member

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SUREFIRE-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace SUREFIRE-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its clean install).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@michael-o michael-o changed the title First try [SUREFIRE-2245] Upgrade to Parent 42 and Maven 3.6.3 May 30, 2024
"Requested toolchain specification did not match any configured toolchain: "
+ getJdkToolchain());
}
tc = tcs.get(0);
Copy link
Member Author

Choose a reason for hiding this comment

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

Guys, please check wether this is correct logically...

Copy link
Member

Choose a reason for hiding this comment

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

looks similar to reflection way

Copy link
Member Author

Choose a reason for hiding this comment

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

True, but simply hides code complexity. It is has no further use. I wouldn't necessarily delete it.

new MockToolchainManager(expected, null),
mock(MavenSession.class),
emptyMap());
Toolchain actual = invokeMethod(AbstractSurefireMojo.class, "getToolchain");
Copy link
Member Author

Choose a reason for hiding this comment

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

I have disabled a few tests because they do not work, but I believe that they are redundant now because we don't use any reflection. I am inclined to delete all disabled ones. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

delete it

@michael-o
Copy link
Member Author

@sormuras and @juliette-derancourt: Can you have a look at my changes in:

  • surefire-its/src/test/resources/junit-4-5/pom.xml
  • surefire-its/src/test/resources/junit5-suite/pom.xml

Maven Parent 42 updated to latest JUnit 1.10.x/5.10.x the use case started to fail because of junit-team/junit5@b41ae69. Mixed dependencies, ABI incompat.

My questions to you both:

  • Is that correct to do so in that case?
  • We have documented in ./maven-surefire-plugin/src/site/apt/examples/jpms.apt.vm, ./maven-surefire-plugin/src/site/apt/examples/junit-platform.apt.vm, ./maven-surefire-plugin/src/site/apt/usage.apt.vm that only two deps need to be supplied, in contrast to that what I have in those ITs. Should we modify docs and require junit-platform-engine to be set as well?

@sormuras
Copy link
Contributor

sormuras commented May 30, 2024

This IT should include a 5.10.2/1.8.5 row for JUnit 5.10.2 and JQwik 1.8.5:


And soon one for JUnit 5.11.0 (could already inserted as 5.11.0-M2) too.

Maven Parent 42 updated to latest JUnit 1.10.x/5.10.x the use case started to fail because of junit-team/junit5@b41ae69. Mixed dependencies, ABI incompat.

I don't see the "Mixed dependencies, ABI incompat." in the linked commit. Can you please expound?

@michael-o
Copy link
Member Author

This IT should include a 5.10.2/1.8.5 row for JUnit 5.10.2 and JQwik 1.8.5:

And soon one for JUnit 5.11.0 (could already inserted as 5.11.0-M2) too.

Will do.

Maven Parent 42 updated to latest JUnit 1.10.x/5.10.x the use case started to fail because of junit-team/junit5@b41ae69. Mixed dependencies, ABI incompat.

I don't see the "Mixed dependencies, ABI incompat." in the linked commit. Can you please expound?

When you run the ITs manually from the dir to analyze the failure you see this classpath:

common-java5-3.2.6-SNAPSHOT.jar
junit-jupiter-engine-5.9.3.jar
junit-platform-engine-1.10.2.jar
junit-platform-launcher-1.10.2.jar
junit-platform-suite-1.9.3.jar
junit-platform-suite-commons-1.9.3.jar
junit-platform-suite-engine-1.9.3.jar
maven-surefire-common-3.2.6-SNAPSHOT.jar
surefire-api-3.2.6-SNAPSHOT.jar
surefire-booter-3.2.6-SNAPSHOT.jar
surefire-extensions-api-3.2.6-SNAPSHOT.jar
surefire-extensions-spi-3.2.6-SNAPSHOT.jar
surefire-junit-platform-3.2.6-SNAPSHOT.jar
surefire-logger-api-3.2.6-SNAPSHOT.jar
surefire-shared-utils-3.2.6-SNAPSHOT.jar

The mix of 1.10.2 and 1.9.3/5.9.3 don't play nice together, if you want I can procude the error for you. I had this signature missing due to the broken CP: org.junit.platform.commons.util.ExceptionUtils.findNestedThrowables(Ljava/lang/Throwable;)Ljava/util/List;

@sormuras
Copy link
Contributor

According to https://junit.org/junit5/docs/current/user-guide/#running-tests-build-maven "it is recommended to use the JUnit Platform BOM to align the versions of all JUnit 5 artifacts." Perhaps the Surefire ITs should follow this advice.

Reading on it says:

To configure support for JUnit Jupiter based tests, configure test scoped dependencies on the JUnit Jupiter API and the JUnit Jupiter TestEngine implementation similar to the following.

    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>5.10.2</version> <!-- can be omitted when using the BOM -->
        <scope>test</scope>
    </dependency>

michael-o added a commit that referenced this pull request May 30, 2024
@sormuras
Copy link
Contributor

Just found another outdated IT:

args.add(new Object[] {"1.9.1", "5.9.1", "1.2.0", "1.1.2"});

@michael-o
Copy link
Member Author

According to https://junit.org/junit5/docs/current/user-guide/#running-tests-build-maven "it is recommended to use the JUnit Platform BOM to align the versions of all JUnit 5 artifacts." Perhaps the Surefire ITs should follow this advice.

Reading on it says:

To configure support for JUnit Jupiter based tests, configure test scoped dependencies on the JUnit Jupiter API and the JUnit Jupiter TestEngine implementation similar to the following.

    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>5.10.2</version> <!-- can be omitted when using the BOM -->
        <scope>test</scope>
    </dependency>

Tried to following:

osipovmi@deblndw011x:~/var/Projekte/maven-surefire/surefire-its/src/test/resources/junit-4-5 (parent-42-maven-3.6.3 *=)
$ git diff
diff --git a/surefire-its/src/test/resources/junit-4-5/pom.xml b/surefire-its/src/test/resources/junit-4-5/pom.xml
index 9a9d69c27..9dddede92 100644
--- a/surefire-its/src/test/resources/junit-4-5/pom.xml
+++ b/surefire-its/src/test/resources/junit-4-5/pom.xml
@@ -135,12 +135,26 @@
             </build>
         </profile>
         <profile>
-            <id>select-junit5</id>
+           <id>select-junit5</id>
+
+
+<dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>org.junit</groupId>
+            <artifactId>junit-bom</artifactId>
+            <version>5.9.1</version>
+            <type>pom</type>
+            <scope>import</scope>
+        </dependency>
+    </dependencies>
+</dependencyManagement>
+
+
             <dependencies>
                 <dependency>
                     <groupId>org.junit.jupiter</groupId>
                     <artifactId>junit-jupiter-api</artifactId>
-                    <version>5.9.1</version>
                     <scope>test</scope>
                 </dependency>
                 <dependency>
@@ -161,11 +175,6 @@
                                 <artifactId>junit-jupiter-engine</artifactId>
                                 <version>5.9.1</version>
                             </dependency>
-                            <dependency>
-                                <groupId>org.junit.platform</groupId>
-                                <artifactId>junit-platform-engine</artifactId>
-                                <version>1.9.1</version>
-                          </dependency>
                         </dependencies>
                     </plugin>
                 </plugins>

and I am back to

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.6-SNAPSHOT:test (default-test) on project junit-4-5:
[ERROR]
[ERROR] Please refer to /var/osipovmi/Projekte/maven-surefire/surefire-its/src/test/resources/junit-4-5/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] org.junit.platform.commons.util.ExceptionUtils.findNestedThrowables(Ljava/lang/Throwable;)Ljava/util/List;
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] org.junit.platform.commons.util.ExceptionUtils.findNestedThrowables(Ljava/lang/Throwable;)Ljava/util/List;
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:628)
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:285)
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:250)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1224)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1073)

because of the plugin classpath:

[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-surefire-plugin:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.plugins:maven-surefire-plugin:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.junit.jupiter:junit-jupiter-engine:jar:5.9.1
[DEBUG]   Included: org.junit.platform:junit-platform-engine:jar:1.10.2
[DEBUG]   Included: org.opentest4j:opentest4j:jar:1.3.0
[DEBUG]   Included: org.junit.platform:junit-platform-commons:jar:1.10.2
[DEBUG]   Included: org.junit.jupiter:junit-jupiter-api:jar:5.10.2
[DEBUG]   Included: org.apiguardian:apiguardian-api:jar:1.1.2
[DEBUG]   Included: org.apache.maven.surefire:maven-surefire-common:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.surefire:surefire-api:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.surefire:surefire-logger-api:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.surefire:surefire-extensions-api:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.surefire:surefire-booter:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.surefire:surefire-extensions-spi:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.resolver:maven-resolver-util:jar:1.4.1
[DEBUG]   Included: org.apache.maven.shared:maven-common-artifact-filters:jar:3.1.1
[DEBUG]   Included: commons-io:commons-io:jar:2.16.1
[DEBUG]   Included: org.codehaus.plexus:plexus-java:jar:1.2.0
[DEBUG]   Included: org.ow2.asm:asm:jar:9.6
[DEBUG]   Included: com.thoughtworks.qdox:qdox:jar:2.0.3
[DEBUG]   Included: org.apache.maven.surefire:surefire-shared-utils:jar:3.2.6-SNAPSHOT

with the fix it is:

[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-surefire-plugin:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.plugins:maven-surefire-plugin:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.junit.jupiter:junit-jupiter-engine:jar:5.9.1
[DEBUG]   Included: org.junit.jupiter:junit-jupiter-api:jar:5.10.2
[DEBUG]   Included: org.apiguardian:apiguardian-api:jar:1.1.2
[DEBUG]   Included: org.junit.platform:junit-platform-engine:jar:1.9.1
[DEBUG]   Included: org.opentest4j:opentest4j:jar:1.2.0
[DEBUG]   Included: org.junit.platform:junit-platform-commons:jar:1.10.2
[DEBUG]   Included: org.apache.maven.surefire:maven-surefire-common:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.surefire:surefire-api:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.surefire:surefire-logger-api:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.surefire:surefire-extensions-api:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.surefire:surefire-booter:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.surefire:surefire-extensions-spi:jar:3.2.6-SNAPSHOT
[DEBUG]   Included: org.apache.maven.resolver:maven-resolver-util:jar:1.4.1
[DEBUG]   Included: org.apache.maven.shared:maven-common-artifact-filters:jar:3.1.1
[DEBUG]   Included: commons-io:commons-io:jar:2.16.1
[DEBUG]   Included: org.codehaus.plexus:plexus-java:jar:1.2.0
[DEBUG]   Included: org.ow2.asm:asm:jar:9.6
[DEBUG]   Included: com.thoughtworks.qdox:qdox:jar:2.0.3
[DEBUG]   Included: org.apache.maven.surefire:surefire-shared-utils:jar:3.2.6-SNAPSHOT

@sormuras
Copy link
Contributor

sormuras commented May 30, 2024

Outdated in terms of what?

In lacking a line for args.add(new Object[] {"1.10.2", "5.10.2", "1.3.0", "1.1.2"});

Tried to following:

Going from <artifactId>junit-jupiter-api</artifactId> to <artifactId>junit-jupiter</artifactId> does not help either?

@sormuras
Copy link
Contributor

IIRC there's some mapping magic in Surefire code that tries to find the correct Platform version based on the Jupiter version used in tests. Perhaps, that magic is outdated too? 🤔

@michael-o
Copy link
Member Author

IIRC there's some mapping magic in Surefire code that tries to find the correct Platform version based on the Jupiter version used in tests. Perhaps, that magic is outdated too? 🤔

That maybe true, but that is out of scope for this issue.

@michael-o
Copy link
Member Author

Outdated in terms of what?

In lacking a line for args.add(new Object[] {"1.10.2", "5.10.2", "1.3.0", "1.1.2"});

Tried to following:

Going from <artifactId>junit-jupiter-api</artifactId> to <artifactId>junit-jupiter</artifactId> does not help either?

Did, no change. fails with:

Caused by: org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
org.junit.platform.engine.TestDescriptor.getAncestors()Ljava/util/Set;
java.lang.NoSuchMethodError: org.junit.platform.engine.TestDescriptor.getAncestors()Ljava/util/Set;
        at org.junit.platform.launcher.core.StackTracePruningEngineExecutionListener.getTestClassNames(StackTracePruningEngineExecutionListener.java:50)
        at org.junit.platform.launcher.core.StackTracePruningEngineExecutionListener.executionFinished(StackTracePruningEngineExecutionListener.java:39)

@michael-o
Copy link
Member Author

@sormuras, here is the magic:

final class JUnitPlatformProviderInfo implements ProviderInfo {
private static final String PROVIDER_DEP_GID = "org.junit.platform";
private static final String PROVIDER_DEP_AID = "junit-platform-launcher";
private final Artifact junitPlatformRunnerArtifact;
private final Artifact junitPlatformArtifact;
private final TestClassPath testClasspath;
JUnitPlatformProviderInfo(
Artifact junitPlatformRunnerArtifact,
Artifact junitPlatformArtifact,
@Nonnull TestClassPath testClasspath) {
this.junitPlatformRunnerArtifact = junitPlatformRunnerArtifact;
this.junitPlatformArtifact = junitPlatformArtifact;
this.testClasspath = testClasspath;
}
@Override
@Nonnull
public String getProviderName() {
return "org.apache.maven.surefire.junitplatform.JUnitPlatformProvider";
}
@Override
public boolean isApplicable() {
return junitPlatformRunnerArtifact == null && junitPlatformArtifact != null;
}
@Override
public void addProviderProperties() {
convertGroupParameters();
convertJunitEngineParameters();
}
@Nonnull
@Override
public List<String[]> getJpmsArguments(@Nonnull ProviderRequirements forkRequirements) {
boolean hasTestDescriptor = forkRequirements.isModularPath() && forkRequirements.hasTestModuleDescriptor();
return hasTestDescriptor ? getJpmsArgs() : Collections.<String[]>emptyList();
}
@Override
@Nonnull
public Set<Artifact> getProviderClasspath() throws MojoExecutionException {
String surefireVersion = getBooterArtifact().getBaseVersion();
Map<String, Artifact> providerArtifacts = surefireDependencyResolver.getProviderClasspathAsMap(
session.getRepositorySession(),
project.getRemotePluginRepositories(),
"surefire-junit-platform",
surefireVersion);
Map<String, Artifact> testDeps = testClasspath.getTestDependencies();
Plugin plugin = getPluginDescriptor().getPlugin();
Map<String, Artifact> pluginDeps = surefireDependencyResolver.resolvePluginDependencies(
session.getRepositorySession(),
project.getRemotePluginRepositories(),
plugin,
getPluginArtifactMap());
if (hasDependencyPlatformEngine(pluginDeps)) {
providerArtifacts.putAll(pluginDeps);
} else {
String engineVersion = null;
if (hasDependencyJupiterAPI(testDeps)
&& !testDeps.containsKey("org.junit.jupiter:junit-jupiter-engine")) {
String engineGroupId = "org.junit.jupiter";
String engineArtifactId = "junit-jupiter-engine";
String engineCoordinates = engineGroupId + ":" + engineArtifactId;
String api = "org.junit.jupiter:junit-jupiter-api";
engineVersion = testDeps.get(api).getBaseVersion();
getConsoleLogger()
.debug("Test dependencies contain " + api + ". Resolving " + engineCoordinates + ":"
+ engineVersion);
addEngineByApi(engineGroupId, engineArtifactId, engineVersion, providerArtifacts);
}
if ((testDeps.containsKey("junit:junit") || testDeps.containsKey("junit:junit-dep"))
&& !testDeps.containsKey("org.junit.vintage:junit-vintage-engine")) {
String engineGroupId = "org.junit.vintage";
String engineArtifactId = "junit-vintage-engine";
String engineCoordinates = engineGroupId + ":" + engineArtifactId;
if (engineVersion != null) {
getConsoleLogger()
.debug("Test dependencies contain JUnit4. Resolving " + engineCoordinates + ":"
+ engineVersion);
addEngineByApi(engineGroupId, engineArtifactId, engineVersion, providerArtifacts);
}
}
}
narrowDependencies(providerArtifacts, testDeps);
alignProviderVersions(providerArtifacts);
return new LinkedHashSet<>(providerArtifacts.values());
}
private List<String[]> getJpmsArgs() {
List<String[]> args = new ArrayList<>();
args.add(new String[] {
"--add-opens", "org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED"
});
args.add(new String[] {
"--add-opens", "org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED"
});
return args;
}
private void addEngineByApi(
String engineGroupId,
String engineArtifactId,
String engineVersion,
Map<String, Artifact> providerArtifacts)
throws MojoExecutionException {
for (Artifact dep : resolve(engineGroupId, engineArtifactId, engineVersion, null, "jar")) {
String key = dep.getGroupId() + ":" + dep.getArtifactId();
providerArtifacts.put(key, dep);
}
}
private void narrowDependencies(
Map<String, Artifact> providerArtifacts, Map<String, Artifact> testDependencies) {
providerArtifacts.keySet().removeAll(testDependencies.keySet());
}
private void alignProviderVersions(Map<String, Artifact> providerArtifacts) throws MojoExecutionException {
String version = junitPlatformArtifact.getBaseVersion();
for (Artifact launcherArtifact : resolve(PROVIDER_DEP_GID, PROVIDER_DEP_AID, version, null, "jar")) {
String key = launcherArtifact.getGroupId() + ":" + launcherArtifact.getArtifactId();
if (providerArtifacts.containsKey(key)) {
providerArtifacts.put(key, launcherArtifact);
}
}
}
private Set<Artifact> resolve(String g, String a, String v, String c, String t) throws MojoExecutionException {
ArtifactHandler handler = junitPlatformArtifact.getArtifactHandler();
Artifact artifact = new DefaultArtifact(g, a, v, null, t, c, handler);
getConsoleLogger().debug("Resolving artifact " + g + ":" + a + ":" + v);
Set<Artifact> r = surefireDependencyResolver.resolveArtifacts(
session.getRepositorySession(), project.getRemoteProjectRepositories(), artifact);
getConsoleLogger().debug("Resolved artifact " + g + ":" + a + ":" + v + " to " + r);
return r;
}
private boolean hasDependencyJupiterAPI(Map<String, Artifact> dependencies) {
return dependencies.containsKey("org.junit.jupiter:junit-jupiter-api");
}
private boolean hasDependencyPlatformEngine(Map<String, Artifact> dependencies) {
for (Entry<String, Artifact> dependency : dependencies.entrySet()) {
if (dependency.getKey().equals("org.junit.platform:junit-platform-engine")) {
return true;
}
}
return false;
}
}

@michael-o
Copy link
Member Author

michael-o commented May 30, 2024

This works:

$ git diff
diff --git a/surefire-its/src/test/resources/junit-4-5/pom.xml b/surefire-its/src/test/resources/junit-4-5/pom.xml
index 9a9d69c27..e55fd9b4e 100644
--- a/surefire-its/src/test/resources/junit-4-5/pom.xml
+++ b/surefire-its/src/test/resources/junit-4-5/pom.xml
@@ -139,7 +139,7 @@
             <dependencies>
                 <dependency>
                     <groupId>org.junit.jupiter</groupId>
-                    <artifactId>junit-jupiter-api</artifactId>
+                    <artifactId>junit-jupiter</artifactId>
                     <version>5.9.1</version>
                     <scope>test</scope>
                 </dependency>
@@ -155,18 +155,6 @@
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-surefire-plugin</artifactId>
-                        <dependencies>
-                            <dependency>
-                                <groupId>org.junit.jupiter</groupId>
-                                <artifactId>junit-jupiter-engine</artifactId>
-                                <version>5.9.1</version>
-                            </dependency>
-                            <dependency>
-                                <groupId>org.junit.platform</groupId>
-                                <artifactId>junit-platform-engine</artifactId>
-                                <version>1.9.1</version>
-                          </dependency>
-                        </dependencies>
                     </plugin>
                 </plugins>
             </build>

I'll try that...

@michael-o
Copy link
Member Author

This works:

$ git diff
diff --git a/surefire-its/src/test/resources/junit-4-5/pom.xml b/surefire-its/src/test/resources/junit-4-5/pom.xml
index 9a9d69c27..e55fd9b4e 100644
--- a/surefire-its/src/test/resources/junit-4-5/pom.xml
+++ b/surefire-its/src/test/resources/junit-4-5/pom.xml
@@ -139,7 +139,7 @@
             <dependencies>
                 <dependency>
                     <groupId>org.junit.jupiter</groupId>
-                    <artifactId>junit-jupiter-api</artifactId>
+                    <artifactId>junit-jupiter</artifactId>
                     <version>5.9.1</version>
                     <scope>test</scope>
                 </dependency>
@@ -155,18 +155,6 @@
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-surefire-plugin</artifactId>
-                        <dependencies>
-                            <dependency>
-                                <groupId>org.junit.jupiter</groupId>
-                                <artifactId>junit-jupiter-engine</artifactId>
-                                <version>5.9.1</version>
-                            </dependency>
-                            <dependency>
-                                <groupId>org.junit.platform</groupId>
-                                <artifactId>junit-platform-engine</artifactId>
-                                <version>1.9.1</version>
-                          </dependency>
-                        </dependencies>
                     </plugin>
                 </plugins>
             </build>

I'll try that...

Tried, while it works it gives a different classpath, thus different results. Profile select-junit4 does not select 4. I will leave as-is now.

michael-o added a commit that referenced this pull request May 30, 2024
Note: With the internal upgrade to JUnit 5.10.x we need to force the
junit-platform-engine version in the plugin classpath in some cases
otherwise we will have a mismatch.

This closes #737
Note: With the internal upgrade to JUnit 5.10.x we need to force the
junit-platform-engine version in the plugin classpath in some cases
otherwise we will have a mismatch which will lead to undefined behavior.

This closes #737
@asfgit asfgit closed this in 71d2214 Jun 4, 2024
@asfgit asfgit merged commit 71d2214 into master Jun 4, 2024
37 checks passed
@michael-o michael-o deleted the parent-42-maven-3.6.3 branch June 4, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants