[MNG-7698] Support comments in maven.config (#1134)

This commit is contained in:
Guillaume Nodet 2023-06-04 07:10:57 +02:00 committed by GitHub
parent 84e133df7c
commit c124554316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -388,7 +388,8 @@ void cli(CliRequest cliRequest) throws Exception {
if (configFile.isFile()) {
try (Stream<String> lines = Files.lines(configFile.toPath(), Charset.defaultCharset())) {
String[] args = lines.filter(arg -> !arg.isEmpty()).toArray(String[]::new);
String[] args = lines.filter(arg -> !arg.isEmpty() && !arg.startsWith("#"))
.toArray(String[]::new);
mavenConfig = cliManager.parse(args);
List<?> unrecognized = mavenConfig.getArgList();
if (!unrecognized.isEmpty()) {

View File

@ -1,3 +1,4 @@
# a comment
-T
3
-Drevision=1.3.0