This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch mvnd-1.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
The following commit(s) were added to refs/heads/mvnd-1.x by this push:
new f026b2da Raise the forkNode SPI floor to Surefire 3.0.0-M6
f026b2da is described below
commit f026b2daff44ccf5cfdfcefbfd805796705cbbca
Author: Arturo Bernal <[email protected]>
AuthorDate: Tue Nov 3 20:46:10 2026 +0100
Raise the forkNode SPI floor to Surefire 3.0.0-M6
MvndForkNodeFactory is compiled against
org.apache.maven.surefire.api.fork.ForkNodeArguments
and api.event, which first ship in Surefire 3.0.0-M6. In 3.0.0-M5 the
equivalent type is
still org.apache.maven.surefire.extensions.ForkNodeArguments, in
surefire-extensions-api, so
injecting <forkNode> into a 3.0.0-M5 build fails with "Cannot set
'forkNode' ...
ForkNodeArguments: ForkNodeArguments" before any test runs. The 2.x port in
#1713 has the
same minimum-version check.
Claude-Session: https://claude.ai/code/session_0153qyh22xBMN1vPfWGz3jSH
---
.../mvnd/daemon/MvndTestProgressLifecycleParticipant.java | 10 ++++++----
.../mvnd/daemon/MvndTestProgressLifecycleParticipantTest.java | 6 ++++--
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git
a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/MvndTestProgressLifecycleParticipant.java
b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/MvndTestProgressLifecycleParticipant.java
index 52703427..3e6f346c 100644
---
a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/MvndTestProgressLifecycleParticipant.java
+++
b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/MvndTestProgressLifecycleParticipant.java
@@ -104,9 +104,11 @@ public class MvndTestProgressLifecycleParticipant extends
AbstractMavenLifecycle
}
/**
- * The {@code forkNode} extension SPI ({@code ForkNodeFactory} / {@code
SurefireForkNodeFactory}) exists only in
- * Surefire {@code >= 3.0.0-M5}. Injecting {@code <forkNode>} into
anything older makes the build fail hard
- * ("unknown parameter forkNode" or a missing implementation class), so
guard on the resolved plugin version.
+ * The {@code org.apache.maven.surefire.api.fork.ForkNodeArguments} /
{@code api.event} packages that
+ * {@code MvndForkNodeFactory} is compiled against exist only in Surefire
{@code >= 3.0.0-M6}; in {@code 3.0.0-M5}
+ * the equivalent type is still {@code
org.apache.maven.surefire.extensions.ForkNodeArguments}, in a different
+ * module. Injecting {@code <forkNode>} into anything older than M6 makes
the build fail hard ("unknown
+ * parameter forkNode" or a missing implementation class), so guard on the
resolved plugin version.
*/
static boolean supportsForkNode(String version) {
if (version == null) {
@@ -127,6 +129,6 @@ public class MvndTestProgressLifecycleParticipant extends
AbstractMavenLifecycle
return true;
}
String milestone = m.group(4);
- return milestone == null || Integer.parseInt(milestone) >= 5;
+ return milestone == null || Integer.parseInt(milestone) >= 6;
}
}
diff --git
a/daemon/src/test/java/org/mvndaemon/mvnd/daemon/MvndTestProgressLifecycleParticipantTest.java
b/daemon/src/test/java/org/mvndaemon/mvnd/daemon/MvndTestProgressLifecycleParticipantTest.java
index 7643e22d..9e5bdf97 100644
---
a/daemon/src/test/java/org/mvndaemon/mvnd/daemon/MvndTestProgressLifecycleParticipantTest.java
+++
b/daemon/src/test/java/org/mvndaemon/mvnd/daemon/MvndTestProgressLifecycleParticipantTest.java
@@ -27,12 +27,14 @@ class MvndTestProgressLifecycleParticipantTest {
@Test
void injectsOnlyForSurefireVersionsThatSupportForkNode() {
- // forkNode SPI exists since 3.0.0-M5 -> anything older must be
skipped so the build never fails
+ // the org.apache.maven.surefire.api.fork/event packages
MvndForkNodeFactory needs ship in 3.0.0-M6 ->
+ // anything older, including M5, must be skipped so the build never
fails
assertFalse(MvndTestProgressLifecycleParticipant.supportsForkNode(null));
assertFalse(MvndTestProgressLifecycleParticipant.supportsForkNode("2.22.2"));
assertFalse(MvndTestProgressLifecycleParticipant.supportsForkNode("3.0.0-M4"));
+
assertFalse(MvndTestProgressLifecycleParticipant.supportsForkNode("3.0.0-M5"));
-
assertTrue(MvndTestProgressLifecycleParticipant.supportsForkNode("3.0.0-M5"));
+
assertTrue(MvndTestProgressLifecycleParticipant.supportsForkNode("3.0.0-M6"));
assertTrue(MvndTestProgressLifecycleParticipant.supportsForkNode("3.0.0-M8"));
assertTrue(MvndTestProgressLifecycleParticipant.supportsForkNode("3.5.6"));
assertTrue(MvndTestProgressLifecycleParticipant.supportsForkNode("4.0.0"));