[MNG-7698] Allow comments in .mvn/maven.config (#1141)

Backport of https://github.com/apache/maven/pull/1134

---

https://issues.apache.org/jira/browse/MNG-7698
This commit is contained in:
Tamas Cservenak 2023-06-04 07:11:11 +02:00 committed by GitHub
parent 76b27ec321
commit 3c29fa5e74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -382,7 +382,8 @@ public class MavenCli {
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