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 2022/02/26 16:28:28 UTC

[GitHub] [maven-invoker] slawekjaranowski opened a new pull request #43: [MSHARED-1019] Allow pass raw cli option to Maven process

slawekjaranowski opened a new pull request #43:
URL: https://github.com/apache/maven-invoker/pull/43


   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
    - [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/projects/MSHARED) filed 
          for the change (usually before you start working on it).  Trivial changes like typos do not 
          require a JIRA issue.  Your pull request should address just this issue, without 
          pulling in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line and body.
    - [x] Format the pull request title like `[MSHARED-XXX] - Fixes bug in ApproximateQuantiles`,
          where you replace `MSHARED-XXX` with the appropriate JIRA issue. Best practice
          is to use the JIRA issue title in the pull request title and in the first line of the 
          commit message.
    - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [x] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will 
          be performed on your pull request automatically.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under 
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [x] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   


-- 
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-invoker] michael-o commented on pull request #43: [MSHARED-1019] Allow pass raw cli option to Maven process

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


   What a brittle pain! This will fail sooner or later. I rather prefer an arrray.


-- 
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-invoker] michael-o commented on pull request #43: [MSHARED-1019] Allow pass raw cli option to Maven process

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


   > 😄 No problem we can use array/list of String for argLine in `InvocationRequest` next each element will be passed as-is to `Argument#setValue`
   > 
   > https://github.com/apache/maven-shared-utils/blob/master/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java#L476-L492
   > 
   > Will be better?
   
   Sorry, I seem to be blind again. Which do you compare? A per-line approach or a parser?!
   
   Basically, what I don't understand why we need to parse here although the MavenCli class will do that. Talked about this several times with @cstamas .


-- 
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-invoker] slawekjaranowski commented on pull request #43: [MSHARED-1019] Allow pass raw cli option to Maven process

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on pull request #43:
URL: https://github.com/apache/maven-invoker/pull/43#issuecomment-1054033868


   You provide whole additional args as String.
   
   argLine is passed to shared-utils - `Commandline#createArg()` and finally is parsed by `CommandLineUtils.translateCommandline()`


-- 
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-invoker] slawekjaranowski commented on pull request #43: [MSHARED-1019] Allow pass raw cli option to Maven process

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on pull request #43:
URL: https://github.com/apache/maven-invoker/pull/43#issuecomment-1054187720


   I don't parse argLinie, it is pass **as-is** to shared-utils - `Commandline#createArg().setLine(...)`, 
   what happens in shared-utils is hidden for invoker


-- 
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-invoker] slawekjaranowski commented on a change in pull request #43: [MSHARED-1019] Allow pass raw cli option to Maven process

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on a change in pull request #43:
URL: https://github.com/apache/maven-invoker/pull/43#discussion_r816508964



##########
File path: src/main/java/org/apache/maven/shared/invoker/MavenCommandLineBuilder.java
##########
@@ -104,6 +104,8 @@ public Commandline build( InvocationRequest request )
 
         setThreads( request, cli );
 
+        setArgsLine( request, cli );

Review comment:
       fixed




-- 
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-invoker] slawekjaranowski commented on pull request #43: [MSHARED-1019] Allow pass raw cli option to Maven process

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on pull request #43:
URL: https://github.com/apache/maven-invoker/pull/43#issuecomment-1054055061


   😄 
   No problem we can use array/list of String for argLine in `InvocationRequest`
   next each element  will be passed as-is to `Argument#setValue`
   
   https://github.com/apache/maven-shared-utils/blob/master/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java#L476-L492
   
    Will be better?


-- 
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-invoker] slawekjaranowski merged pull request #43: [MSHARED-1019] Allow pass raw cli option to Maven process

Posted by GitBox <gi...@apache.org>.
slawekjaranowski merged pull request #43:
URL: https://github.com/apache/maven-invoker/pull/43


   


-- 
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-invoker] michael-o commented on pull request #43: [MSHARED-1019] Allow pass raw cli option to Maven process

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


   I do not fully understand how this works. Can I set args one by one as with a list/array?


-- 
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-invoker] michael-o commented on pull request #43: [MSHARED-1019] Allow pass raw cli option to Maven process

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


   @slawekjaranowski Yes, retain previous ones is correct, but new ones should be:
   
   ```
   invocationRequest.addArg("-B")
   invocationRequest.addArg("-Dfoo=bar")
   ```
   
   I have a very special opinion CLI tools on shared utils. I consider 80% of the code as useless.


-- 
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-invoker] slawekjaranowski commented on pull request #43: [MSHARED-1019] Allow pass raw cli option to Maven process

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on pull request #43:
URL: https://github.com/apache/maven-invoker/pull/43#issuecomment-1054171627


   Now I'm also confused .... 
   Do you think about `InvocationRequest` which contains method like .... `setDebug`, `setOffline` ... and so on for other Maven options?, So it is historical ... and for compatibility must be preserved 
   
   With my PR you needn't us it, and simply:
   
   ```
   invocationRequest.setArgLineAtEnd("-e -B clean verify");
   invoker.execute( invocationRequest );
   ```


-- 
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-invoker] olamy commented on pull request #43: [MSHARED-1019] Allow pass raw cli option to Maven process

Posted by GitBox <gi...@apache.org>.
olamy commented on pull request #43:
URL: https://github.com/apache/maven-invoker/pull/43#issuecomment-1054181225


   uhm I tend to agree parsing could be a pain for something such 
   
   ```
   invocationRequest.setArgLineAtEnd("-e -B clean verify -Dfile=c:\\My Files\grhhh windows");
   ```


-- 
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-invoker] michael-o commented on a change in pull request #43: [MSHARED-1019] Allow pass raw cli option to Maven process

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



##########
File path: src/main/java/org/apache/maven/shared/invoker/MavenCommandLineBuilder.java
##########
@@ -104,6 +104,8 @@ public Commandline build( InvocationRequest request )
 
         setThreads( request, cli );
 
+        setArgsLine( request, cli );

Review comment:
       Wouldn't setArgs be better? 




-- 
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