pzygielo opened a new issue, #11850:
URL: https://github.com/apache/maven/issues/11850
### New feature, improvement proposal
1. Given the command:
```
mvn -V -q help:help
```
2. The command, with `.mvn/maven.config`:
```
-ntp
--threads
1C
```
gives:
```
Apache Maven 3.9.14 (996c630dbc656c76214ce58821dcc58be960875b)
...
Java version: 21.0.10, vendor: Red Hat, Inc., runtime: ...
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux" ...
```
It's fine.
3. The same command with `.mvn/maven.config`:
```
-ntp
--threads
1
```
gives:
```
Apache Maven 3.9.14 (996c630dbc656c76214ce58821dcc58be960875b)
...
Java version: 21.0.10, vendor: Red Hat, Inc., runtime: ...
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux" ...
[ERROR] Error executing Maven.
[ERROR] Invalid threads value: ' 1'. Supported are integer values.
```
4. Command could be also used w/o `maven.config` like so:
```
mvn -V -q help:help -T ' 1C' # a
mvn -V -q help:help -T ' 1' # b
```
which also works for case _a_ and doesn't for _b_.
5. Having leading or trailing space in option gives something like
```
org.apache.commons.cli.ParseException: Unrecognized maven.config file
entries: [ -ntp ]
```
or
```
Unable to parse maven.config file options: Unrecognized option: -ntp
```
which might come from `commons-cli`.
But as parsing threads value is done in Maven - could it be always trimmed
first?
This is for `Float.parseFloat` (`valueOf`):
https://docs.oracle.com/javase/8/docs/api/java/lang/Float.html#valueOf-java.lang.String-:
> Leading and trailing whitespace characters in `s` are ignored. Whitespace
is removed as if by the
[String.trim()](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#trim--)
method; that is, both ASCII space and control characters are removed. **The
rest** of `s` should constitute a FloatValue ...
But nothing like that happens in `Integer.parseInt`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]