From 193778ec0e780ebf89138f5104ead881c0e3899f Mon Sep 17 00:00:00 2001 From: tssp Date: Wed, 29 Apr 2015 10:22:38 +0200 Subject: [PATCH] [MNG-5816] Empy maven.config cause Maven to exit with failure Avoid adding non empty configuration argument that causes exception. Signed-off-by: Karl Heinz Marbaise --- .../src/main/java/org/apache/maven/cli/MavenCli.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 8ce299f653..034cb004a1 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 @@ -377,7 +377,10 @@ public class MavenCli { for ( String arg : Files.toString( configFile, Charsets.UTF_8 ).split( "\\s+" ) ) { - args.add( arg ); + if ( !arg.isEmpty() ) + { + args.add( arg ); + } } CommandLine config = cliManager.parse( args.toArray( new String[args.size()] ) );