Conversation
| } | ||
|
|
||
| req.setGoals(targetGoals); | ||
| req.addArgs(targetGoals); |
There was a problem hiding this comment.
It is not a good idea. Each argument passed to setGoals are internal parsed, escaped and so on ...
but addArgs pass arguments as is to command line process
look at line 113 additionalArguments is add as one item to list
There was a problem hiding this comment.
This is what the deprecation message says:
/**
* Sets the goals for the Maven invocation.
*
* @param goals The goals for the Maven invocation, may be <code>null</code> to execute the POMs default goal.
* @return This invocation request.
* @deprecated simply {@link #addArg(String)} or {@link #addArgs(Collection)} should be used
*/
Is that wrong then? Should this method be undeprecated?
There was a problem hiding this comment.
It is correctly deprecated ... but when we use new method we need new parameters where user set each command line argument separately
Parsing, escaping arguments are allwaye error prone, so we should required from users to provided it.
There was a problem hiding this comment.
Correct, don't reinvent the wheel you will fail.
No description provided.