You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/07/15 16:58:42 UTC

[GitHub] [maven] michael-o opened a new pull request #488: [MNG-7131] maven.config doesn't handle arguments with spaces in them

michael-o opened a new pull request #488:
URL: https://github.com/apache/maven/pull/488


   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](https://maven.apache.org/configure.html) 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:
   * Consistency between Maven 3 and 4
   * Config files can be changed and will continue to work on older Maven versions
   * All other arg file approaches use a one-arg-per-line approach


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o commented on pull request #488: [MNG-7131] maven.config doesn't handle arguments with spaces in them

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #488:
URL: https://github.com/apache/maven/pull/488#issuecomment-884153196


   Merged.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o commented on a change in pull request #488: [MNG-7131] maven.config doesn't handle arguments with spaces in them

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #488:
URL: https://github.com/apache/maven/pull/488#discussion_r673421535



##########
File path: maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
##########
@@ -197,6 +197,7 @@ public void testMavenConfigInvalid()
      * <pre>
      *   -T 3
      *   -Drevision=1.3.0
+     *   -Dlabel=Apache Maven

Review comment:
       Fully agree, will change




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] rfscholte commented on pull request #488: [MNG-7131] maven.config doesn't handle arguments with spaces in them

Posted by GitBox <gi...@apache.org>.
rfscholte commented on pull request #488:
URL: https://github.com/apache/maven/pull/488#issuecomment-883711184


   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.
   For me this isn't regression, just an improvement of an edge case, I'll leave it up to you if you want to add such changes too.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] rfscholte commented on a change in pull request #488: [MNG-7131] maven.config doesn't handle arguments with spaces in them

Posted by GitBox <gi...@apache.org>.
rfscholte commented on a change in pull request #488:
URL: https://github.com/apache/maven/pull/488#discussion_r672971833



##########
File path: maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
##########
@@ -223,6 +224,7 @@ public void testMVNConfigurationThreadCanBeOverwrittenViaCommandLine()
      * <pre>
      *   -T 3
      *   -Drevision=1.3.0
+     *   -Dlabel=Apache Maven

Review comment:
       see previous comment

##########
File path: maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
##########
@@ -279,6 +282,7 @@ public void testMVNConfigurationCLIRepeatedPropertiesLastWins()
      * <pre>
      *   -T 3
      *   -Drevision=1.3.0
+     *   -Dlabel=Apache Maven

Review comment:
       see previous comment

##########
File path: maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
##########
@@ -251,6 +253,7 @@ public void testMVNConfigurationDefinedPropertiesCanBeOverwrittenViaCommandLine(
      * <pre>
      *   -T 3
      *   -Drevision=1.3.0
+     *   -Dlabel=Apache Maven

Review comment:
       see previous comment

##########
File path: maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
##########
@@ -197,6 +197,7 @@ public void testMavenConfigInvalid()
      * <pre>
      *   -T 3
      *   -Drevision=1.3.0
+     *   -Dlabel=Apache Maven

Review comment:
       I propose to use `-Dlabel="Apache Maven"` or `"-Dlabel=Apache Maven"`, as you would never be able to use `-Dlabel=Apache Maven` from commandline.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] rfscholte commented on a change in pull request #488: [MNG-7131] maven.config doesn't handle arguments with spaces in them

Posted by GitBox <gi...@apache.org>.
rfscholte commented on a change in pull request #488:
URL: https://github.com/apache/maven/pull/488#discussion_r672971833



##########
File path: maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
##########
@@ -223,6 +224,7 @@ public void testMVNConfigurationThreadCanBeOverwrittenViaCommandLine()
      * <pre>
      *   -T 3
      *   -Drevision=1.3.0
+     *   -Dlabel=Apache Maven

Review comment:
       see previous comment

##########
File path: maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
##########
@@ -279,6 +282,7 @@ public void testMVNConfigurationCLIRepeatedPropertiesLastWins()
      * <pre>
      *   -T 3
      *   -Drevision=1.3.0
+     *   -Dlabel=Apache Maven

Review comment:
       see previous comment

##########
File path: maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
##########
@@ -251,6 +253,7 @@ public void testMVNConfigurationDefinedPropertiesCanBeOverwrittenViaCommandLine(
      * <pre>
      *   -T 3
      *   -Drevision=1.3.0
+     *   -Dlabel=Apache Maven

Review comment:
       see previous comment

##########
File path: maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
##########
@@ -197,6 +197,7 @@ public void testMavenConfigInvalid()
      * <pre>
      *   -T 3
      *   -Drevision=1.3.0
+     *   -Dlabel=Apache Maven

Review comment:
       I propose to use `-Dlabel="Apache Maven"` or `"-Dlabel=Apache Maven"`, as you would never be able to use `-Dlabel=Apache Maven` from commandline.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o closed pull request #488: [MNG-7131] maven.config doesn't handle arguments with spaces in them

Posted by GitBox <gi...@apache.org>.
michael-o closed pull request #488:
URL: https://github.com/apache/maven/pull/488


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o commented on pull request #488: [MNG-7131] maven.config doesn't handle arguments with spaces in them

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #488:
URL: https://github.com/apache/maven/pull/488#issuecomment-883719734


   > 
   > 
   > 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.
   > For me this isn't regression, just an improvement of an edge case, I'll leave it up to you if you want to add such changes too.
   
   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o commented on a change in pull request #488: [MNG-7131] maven.config doesn't handle arguments with spaces in them

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #488:
URL: https://github.com/apache/maven/pull/488#discussion_r670652684



##########
File path: maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
##########
@@ -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() ) )

Review comment:
       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.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o commented on pull request #488: [MNG-7131] maven.config doesn't handle arguments with spaces in them

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #488:
URL: https://github.com/apache/maven/pull/488#issuecomment-883684740


   @rfscholte Should this be back ported to 3.8.x too?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org