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

khmarbaise pushed a commit to branch MNG-7989
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 23d13fb322b8d66f03f02ece57d75e154f847367
Author: Karl Heinz Marbaise <khmarba...@apache.org>
AuthorDate: Fri Dec 22 19:12:21 2023 +0100

    [MNG-7989] - Making this build non-interactive, because the environment 
variable CI equals true.
---
 .../src/main/java/org/apache/maven/cli/MavenCli.java      | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java 
b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
index 98bd4092d4..67e458d829 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
@@ -1347,13 +1347,16 @@ public class MavenCli {
             return;
         }
 
-        boolean runningOnCI = isRunningOnCI(cliRequest.getSystemProperties());
-        if (runningOnCI) {
-            slf4jLogger.info("Making this build non-interactive, because the 
environment variable CI equals \"true\"."
-                    + " Disable this detection by removing that variable or 
adding --force-interactive.");
-            request.setInteractiveMode(false);
-        } else if (commandLine.hasOption(BATCH_MODE) || 
commandLine.hasOption(NON_INTERACTIVE)) {
+        if (commandLine.hasOption(BATCH_MODE) || 
commandLine.hasOption(NON_INTERACTIVE)) {
             request.setInteractiveMode(false);
+        } else {
+            boolean runningOnCI = 
isRunningOnCI(cliRequest.getSystemProperties());
+            if (runningOnCI) {
+                slf4jLogger.info(
+                        "Making this build non-interactive, because the 
environment variable CI equals \"true\"."
+                                + " Disable this detection by removing that 
variable or adding --force-interactive.");
+                request.setInteractiveMode(false);
+            }
         }
     }
 

Reply via email to