cstamas commented on code in PR #1604: URL: https://github.com/apache/maven/pull/1604#discussion_r1671265251
########## maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java: ########## @@ -374,25 +376,28 @@ void cli(CliRequest cliRequest) throws Exception { cliManager = new CLIManager(); CommandLine mavenConfig = null; - try { - File configFile = new File(cliRequest.multiModuleProjectDirectory, MVN_MAVEN_CONFIG); - - if (configFile.isFile()) { - try (Stream<String> lines = Files.lines(configFile.toPath(), Charset.defaultCharset())) { - String[] args = lines.filter(arg -> !arg.isEmpty() && !arg.startsWith("#")) - .toArray(String[]::new); - mavenConfig = cliManager.parse(args); - List<?> unrecognized = mavenConfig.getArgList(); - if (!unrecognized.isEmpty()) { - // This file can only contain options, not args (goals or phases) - throw new ParseException("Unrecognized maven.config file entries: " + unrecognized); + if (cliRequest.rootDirectory != null) { + try { + File configFile = Review Comment: Least changes is what I wanted in 3.9, but I can do that (but seems unrelated) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org