Skip to content

Commit

Permalink
feature: maven.executable.options configuration as list of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
imerljak committed May 17, 2024
1 parent 6a90eac commit 4c35826
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ You can use `maven.executable.options` to specify default **options** for all yo
```json
{
"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>
Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -852,4 +862,4 @@
"which": "^1.3.1",
"xml2js": "^0.5.0"
}
}
}
6 changes: 5 additions & 1 deletion src/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4c35826

Please sign in to comment.