[Git][java-team/surefire][master] Restored the forkMode parameter removed in surefire 3.0.0-M8
Emmanuel Bourg (@ebourg)
gitlab at salsa.debian.org
Fri Oct 30 18:16:42 GMT 2026
Emmanuel Bourg pushed to branch master at Debian Java Maintainers / surefire
Commits:
7fb9a89d by Emmanuel Bourg at 2026-10-30T18:37:47+01:00
Restored the forkMode parameter removed in surefire 3.0.0-M8
- - - - -
3 changed files:
- debian/changelog
- + debian/patches/restore-forkmode-parameter.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+surefire (3.5.6-3) unstable; urgency=medium
+
+ * Team upload.
+ * Restored the forkMode parameter removed in surefire 3.0.0-M8
+
+ -- Emmanuel Bourg <ebourg at apache.org> Fri, 30 Oct 2026 18:37:41 +0100
+
surefire (3.5.6-2) unstable; urgency=medium
* Team upload.
=====================================
debian/patches/restore-forkmode-parameter.patch
=====================================
@@ -0,0 +1,80 @@
+Description: Restore the forkMode parameter removed in surefire 3.0.0-M8 (SUREFIRE-1654)
+ Reverts https://github.com/apache/maven-surefire/commit/52f276ba0f by mapping
+ forkMode to the equivalent forkCount and reuseForks values.
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: not-needed
+--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
++++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+@@ -583,6 +583,23 @@
+ private boolean reuseForks;
+
+ /**
++ * <strong>DEPRECATED</strong> since version 2.14. Use {@code forkCount} and {@code reuseForks} instead.
++ * <br>
++ * <br>
++ * Option to specify the forking mode. Can be {@code never}, {@code once}, {@code always}, {@code perthread}.<br>
++ * The {@code none} and {@code pertest} are also accepted for backwards compatibility.<br>
++ * The {@code always} forks for each test-class.<br>
++ * The {@code perthread} creates the number of parallel forks specified by {@code threadCount}, where each forked
++ * JVM is executing one test-class. See also the parameter {@code reuseForks} for the lifetime of JVM.
++ *
++ * @since 2.1
++ * @deprecated Use {@code forkCount} and {@code reuseForks} instead.
++ */
++ @Deprecated
++ @Parameter(property = "forkMode")
++ private String forkMode;
++
++ /**
+ * (JUnit 4.7 provider) Indicates that threadCount, threadCountSuites, threadCountClasses, threadCountMethods
+ * are per cpu core.
+ *
+@@ -1098,6 +1115,8 @@
+ }
+
+ boolean verifyParameters() throws MojoFailureException, MojoExecutionException {
++ convertDeprecatedForkMode();
++
+ setProperties(new SurefireProperties(getProperties()));
+
+ String jvmToUse = getJvm();
+@@ -2466,6 +2485,39 @@
+ }
+
+ @SuppressWarnings("checkstyle:emptyblock")
++ private void convertDeprecatedForkMode() throws MojoFailureException {
++ if (forkMode == null || forkMode.trim().isEmpty()) {
++ return;
++ }
++
++ String mode = forkMode.trim();
++ getConsoleLogger()
++ .warning("The parameter forkMode is deprecated, use forkCount and reuseForks instead (forkMode="
++ + mode + ")");
++ switch (mode) {
++ case "never":
++ case "none":
++ forkCount = "0";
++ break;
++ case "once":
++ forkCount = "1";
++ reuseForks = true;
++ break;
++ case "always":
++ case "pertest":
++ forkCount = "1";
++ reuseForks = false;
++ break;
++ case "perthread":
++ forkCount = String.valueOf(Math.max(threadCount, 1));
++ reuseForks = false;
++ break;
++ default:
++ throw new MojoFailureException("Invalid forkMode: " + mode
++ + " (expected never, none, once, always, pertest or perthread)");
++ }
++ }
++
+ protected int getEffectiveForkCount() {
+ if (effectiveForkCount < 0) {
+ try {
=====================================
debian/patches/series
=====================================
@@ -5,3 +5,4 @@ jsr305-dependency.patch
shared-utils-optional-shaded-dependencies.patch
disable-doclint.patch
maven-shared-utils-compatibility.patch
+restore-forkmode-parameter.patch
View it on GitLab: https://salsa.debian.org/java-team/surefire/-/commit/7fb9a89d04d5bf7cdb7e235351932f5712d12c6d
--
View it on GitLab: https://salsa.debian.org/java-team/surefire/-/commit/7fb9a89d04d5bf7cdb7e235351932f5712d12c6d
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20261030/6f7cff72/attachment.htm>
More information about the pkg-java-commits
mailing list