You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2023/10/04 21:25:29 UTC

[maven] branch MNG-7898 created (now ca4b3bd2d5)

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

sjaranowski pushed a change to branch MNG-7898
in repository https://gitbox.apache.org/repos/asf/maven.git


      at ca4b3bd2d5 [MNG-7898] Missing .mvn directory should not be reported in quiet mode

This branch includes the following new commits:

     new ca4b3bd2d5 [MNG-7898] Missing .mvn directory should not be reported in quiet mode

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven] 01/01: [MNG-7898] Missing .mvn directory should not be reported in quiet mode

Posted by sj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ca4b3bd2d5de65b049aa90ab6800d84595a3af36
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Wed Oct 4 23:23:18 2023 +0200

    [MNG-7898] Missing .mvn directory should not be reported in quiet mode
---
 .../src/main/java/org/apache/maven/cli/MavenCli.java           | 10 +++++-----
 1 file changed, 5 insertions(+), 5 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 e5c140ea62..70d0b7dfc6 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
@@ -360,11 +360,7 @@ public class MavenCli {
         // properties will be computed through the RootLocator found in the container.
         RootLocator rootLocator =
                 ServiceLoader.load(RootLocator.class).iterator().next();
-        Path rootDirectory = rootLocator.findRoot(topDirectory);
-        if (rootDirectory == null) {
-            System.err.println(RootLocator.UNABLE_TO_FIND_ROOT_PROJECT_MESSAGE);
-        }
-        cliRequest.rootDirectory = rootDirectory;
+        cliRequest.rootDirectory = rootLocator.findRoot(topDirectory);
 
         //
         // Make sure the Maven home directory is an absolute path to save us from confusion with say drive-relative
@@ -447,6 +443,10 @@ public class MavenCli {
             }
             throw new ExitException(0);
         }
+
+        if (cliRequest.rootDirectory == null) {
+            slf4jLogger.warn(RootLocator.UNABLE_TO_FIND_ROOT_PROJECT_MESSAGE);
+        }
     }
 
     private CommandLine cliMerge(CommandLine mavenConfig, CommandLine mavenCli) {