You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2021/04/16 08:34:00 UTC

[jira] [Comment Edited] (MNG-7131) maven.config doesn't handle arguments with spaces in them

    [ https://issues.apache.org/jira/browse/MNG-7131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17310079#comment-17310079 ] 

Michael Osipov edited comment on MNG-7131 at 4/16/21, 8:33 AM:
---------------------------------------------------------------

[~oehme], I'd be willing to provide a fix for this. Would you be willing to provide an IT with a PR? The most basic one is just like your usecase with a property. This could be written to a file and then verified to be present. We have many ITs of this kind. There is a specialized plugin in the Core IT Suite for this. WDYT?


was (Author: michael-o):
[~oehme], I'd be willing to provide a fix for this. Would you be willing to provide a PR? The most basic one is just like your usecase with a property. This could be written to a file and then verified to be present. We have many ITs of this kind. There is a specialized plugin in the Core IT Suite for this. WDYT?

> maven.config doesn't handle arguments with spaces in them
> ---------------------------------------------------------
>
>                 Key: MNG-7131
>                 URL: https://issues.apache.org/jira/browse/MNG-7131
>             Project: Maven
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 3.6.3
>            Reporter: Stefan Oehme
>            Assignee: Michael Osipov
>            Priority: Minor
>             Fix For: 4.0.x-candidate
>
>
> I tried putting a path with a space in the maven.config like so:
> {code:java}
> "-Dmy.path=/some/path with/a/space"
> {code}
> When asking for the my.path property inside Maven, I get the path with a trailing quote
> {code:java}
> /some/path with/a/space"
> {code}
> The file is parsed by [splitting it by whitespace|https://github.com/apache/maven/blob/c3cf29438e3d65d6ee5c5726f8611af99d9a649a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java#L386]. I suggest replacing that code with the much better [CommandLineUtils.translateCommandline(argLine)|https://github.com/codehaus-plexus/plexus-utils/blob/85a4a3c534752919dd97d757d4ef0fdb6d40eb8c/src/main/java/org/codehaus/plexus/util/cli/CommandLineUtils.java#L412]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)