New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MNG-7131] maven.config doesn't handle arguments with spaces in them #488
Conversation
@@ -387,7 +388,7 @@ void cli( CliRequest cliRequest ) | |||
|
|||
if ( configFile.isFile() ) | |||
{ | |||
for ( String arg : new String( Files.readAllBytes( configFile.toPath() ) ).split( "\\s+" ) ) | |||
for ( String arg : Files.readAllLines( configFile.toPath(), Charset.defaultCharset() ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I have retained the original file encoding because jvm.config
is subject to the same platform encoding. We can consider making maven.config
UTF-8 only.
maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
Outdated
Show resolved
Hide resolved
maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
Outdated
Show resolved
Hide resolved
maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
Outdated
Show resolved
Hide resolved
maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
Outdated
Show resolved
Hide resolved
Since we don't have a clear specification of the file format change reading of the file to a one-arg-per-line basis just like Java's @argfiles or Python's argparse would handle it. Consider that jvm.config suffers from the same issue its parsing is not portable between Bourne shell and Windows Command prompt.
@rfscholte Should this be back ported to 3.8.x too? |
I don't know what your goal with the backport is or what the scope is. I'm just worried that it becomes bigger and bigger. |
Goal is actually consistency when migrating from 3 to 4. But you are right, this isn't a regression. Just an improvement of an edge case. If someone needs that in 3.x they can still raise a hand. |
Merged. |
Since we don't have a clear specification of the file format change
reading of the file to a one-arg-per-line basis just like Java's
@argfiles or Python's argparse would handle it.
Consider that jvm.config suffers from the same issue its parsing is not
portable between Bourne shell and Windows Command prompt.
We also need to change this and mention that
jvm.config
parsing is not portable.I am inclined to backport this to 3.8.x although this might break for people for two reasons: