This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch SUREFIRE-2223
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit caf37e5122b7277d6cdce663f2ad86fa48a46aeb
Author: Michael Osipov <micha...@apache.org>
AuthorDate: Fri Dec 22 19:51:17 2023 +0100

    [SUREFIRE-2223] Surefire evaluates parameter jvm before skip
    
    This closes #703
---
 .../org/apache/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 7c337818a..6dff7cadc 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 @@ public abstract class AbstractSurefireMojo extends 
AbstractMojo implements Suref
 
     @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 @@ public abstract class AbstractSurefireMojo extends 
AbstractMojo implements Suref
 
     boolean verifyParameters() throws MojoFailureException, 
MojoExecutionException {
         setProperties(new SurefireProperties(getProperties()));
-        if (isSkipExecution()) {
-            getConsoleLogger().info("Tests are skipped.");
-            return false;
-        }
 
         String jvmToUse = getJvm();
         if (toolchain != null) {

Reply via email to