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) {