From caf37e5122b7277d6cdce663f2ad86fa48a46aeb Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Fri, 22 Dec 2023 19:51:17 +0100 Subject: [PATCH] [SUREFIRE-2223] Surefire evaluates parameter jvm before skip This closes #703 --- .../maven/plugin/surefire/AbstractSurefireMojo.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 7c337818ad..6dff7cadc1 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 @@ -876,6 +876,11 @@ private String getDefaultExcludes() { @Override public void execute() throws MojoExecutionException, MojoFailureException { + if (isSkipExecution()) { + getConsoleLogger().info("Tests are skipped."); + return; + } + cli = commandLineOptions(); // Stuff that should have been final setupStuff(); @@ -1030,10 +1035,6 @@ DefaultScanResult scanDependencies() throws MojoFailureException { boolean verifyParameters() throws MojoFailureException, MojoExecutionException { setProperties(new SurefireProperties(getProperties())); - if (isSkipExecution()) { - getConsoleLogger().info("Tests are skipped."); - return false; - } String jvmToUse = getJvm(); if (toolchain != null) {