mirror of https://github.com/apache/maven.git
parent
b82479bf11
commit
b17c968a0b
|
@ -41,6 +41,7 @@ import java.util.Set;
|
|||
import java.util.function.Consumer;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
|
@ -346,9 +347,8 @@ public class MavenCli {
|
|||
File configFile = new File(cliRequest.multiModuleProjectDirectory, MVN_MAVEN_CONFIG);
|
||||
|
||||
if (configFile.isFile()) {
|
||||
String[] args = Files.lines(configFile.toPath(), Charset.defaultCharset())
|
||||
.filter(arg -> !arg.isEmpty())
|
||||
.toArray(size -> new String[size]);
|
||||
try (Stream<String> lines = Files.lines(configFile.toPath(), Charset.defaultCharset())) {
|
||||
String[] args = lines.filter(arg -> !arg.isEmpty()).toArray(String[]::new);
|
||||
mavenConfig = cliManager.parse(args);
|
||||
List<?> unrecognized = mavenConfig.getArgList();
|
||||
if (!unrecognized.isEmpty()) {
|
||||
|
@ -356,6 +356,7 @@ public class MavenCli {
|
|||
throw new ParseException("Unrecognized maven.config file entries: " + unrecognized);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
System.err.println("Unable to parse maven.config file options: " + e.getMessage());
|
||||
cliManager.displayHelp(System.out);
|
||||
|
|
Loading…
Reference in New Issue