This is an automated email from the ASF dual-hosted git repository. rmannibucau pushed a commit to branch SUREFIRE-1781 in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
commit a71e86a8f49116140b24aa40eeacf2a828620b2d Author: Romain Manni-Bucau <rmannibu...@gmail.com> AuthorDate: Sat Apr 25 17:31:27 2020 +0200 logging a warning if forkcount=0 --- .../org/apache/maven/plugin/surefire/AbstractSurefireMojo.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git 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 index 112de82..8a0cd0a 100644 --- 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 @@ -1121,10 +1121,20 @@ public abstract class AbstractSurefireMojo warnIfWrongShutdownValue(); warnIfNotApplicableSkipAfterFailureCount(); warnIfIllegalTempDir(); + warnIfForkCountIsZero(); } return true; } + private void warnIfForkCountIsZero() + { + if ( "0".equals( getForkCount() ) ) + { + getConsoleLogger().warning( "The parameter forkCount should likely not be 0, not forking a JVM for tests " + + "reduce test accuracy, ensure to have a <forkCount> >= 1." ); + } + } + private void executeAfterPreconditionsChecked( @Nonnull DefaultScanResult scanResult ) throws MojoExecutionException, MojoFailureException {