feature: maven.executable.options configuration as list of strings (#1032)
* feature: maven.executable.options configuration as list of strings Closes #981 * fix json format in README fix json format in README --------- Co-authored-by: Jinbo Wang <jinbwan@microsoft.com>
This commit is contained in:
Родитель
80733c92df
Коммит
43618e6dff
|
@ -137,7 +137,7 @@ The usage of Maven executable is:
|
|||
You can use `maven.executable.options` to specify default **options** for all your Maven commands executed in current project.
|
||||
```json
|
||||
{
|
||||
"maven.executable.options": "-o -s ./settings.xml" // work offline, and use an alternative settings file
|
||||
"maven.executable.options": "-o -s ./settings.xml" // work offline and use an alternative settings file. Can also be defined as an array of strings, e.g. ["-o", "-s ./settings.xml"]
|
||||
}
|
||||
```
|
||||
</details>
|
||||
|
|
14
package.json
14
package.json
|
@ -662,7 +662,17 @@
|
|||
"scope": "machine"
|
||||
},
|
||||
"maven.executable.options": {
|
||||
"type": "string",
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default": "",
|
||||
"description": "%configuration.maven.executable.options%",
|
||||
"scope": "machine-overridable"
|
||||
|
@ -852,4 +862,4 @@
|
|||
"which": "^1.3.1",
|
||||
"xml2js": "^0.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,11 @@ export class Settings {
|
|||
return _getMavenSection("executable.path", resourceOrFilepath);
|
||||
}
|
||||
public static options(resourceOrFilepath?: Uri | string): string | undefined {
|
||||
return _getMavenSection("executable.options", resourceOrFilepath);
|
||||
const options: string | string[] | undefined = _getMavenSection("executable.options", resourceOrFilepath);
|
||||
if (Array.isArray(options)) {
|
||||
return options.join(' ');
|
||||
}
|
||||
return options;
|
||||
}
|
||||
public static preferMavenWrapper(resourceOrFilepath?: Uri | string): boolean {
|
||||
return !!_getMavenSection<boolean>("executable.preferMavenWrapper", resourceOrFilepath);
|
||||
|
|
Загрузка…
Ссылка в новой задаче