Skip to content

Commit 10db1ba

Browse files
authored
feat: add option for additional maven cli arguments (#802)
1 parent 002e661 commit 10db1ba

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,13 @@
226226
"default": "fallback",
227227
"markdownDescription": "Specifies whether to use the local maven wrapper. The 'fallback' option will default to the value of `#maven.executable.preferMavenWrapper#` from the `Maven for Java` extension, else defaulting to 'true'."
228228
},
229+
"redHatDependencyAnalytics.mvn.additionalArgs": {
230+
"type": "array",
231+
"items": {
232+
"type": "string"
233+
},
234+
"markdownDescription": "List of arguments to pass to maven invocations."
235+
},
229236
"redHatDependencyAnalytics.gradle.executable.path": {
230237
"type": "string",
231238
"default": "",
@@ -422,7 +429,7 @@
422429
"dependencies": {
423430
"@redhat-developer/vscode-redhat-telemetry": "^0.8.0",
424431
"@trustification/exhort-api-spec": "^1.0.13",
425-
"@trustification/exhort-javascript-api": "^0.2.4-ea.2",
432+
"@trustification/exhort-javascript-api": "^0.2.4-ea.3",
426433
"@xml-tools/ast": "^5.0.5",
427434
"@xml-tools/parser": "^1.0.11",
428435
"fs": "^0.0.1-security",

src/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class Config {
2424
vulnerabilityAlertSeverity!: string;
2525
exhortMvnPath!: string;
2626
exhortPreferMvnw!: string;
27+
exhortMvnArgs!: string;
2728
exhortGradlePath!: string;
2829
exhortPreferGradlew!: string;
2930
exhortNpmPath!: string;
@@ -110,6 +111,7 @@ class Config {
110111
this.rhdaReportFilePath = rhdaConfig.reportFilePath || DEFAULT_RHDA_REPORT_FILE_PATH;
111112
this.exhortMvnPath = rhdaConfig.mvn.executable.path || this.DEFAULT_MVN_EXECUTABLE;
112113
this.exhortPreferMvnw = preferMavenWrapper.toString();
114+
this.exhortMvnArgs = JSON.stringify(rhdaConfig.mvn.additionalArgs) || '[]';
113115
this.exhortGradlePath = rhdaConfig.gradle.executable.path || this.DEFAULT_GRADLE_EXECUTABLE;
114116
this.exhortPreferGradlew = preferGradleWrapper.toString();
115117
this.exhortNpmPath = rhdaConfig.npm.executable.path || this.DEFAULT_NPM_EXECUTABLE;
@@ -172,6 +174,7 @@ class Config {
172174
process.env['VSCEXT_VULNERABILITY_ALERT_SEVERITY'] = this.vulnerabilityAlertSeverity;
173175
process.env['VSCEXT_EXHORT_MVN_PATH'] = this.exhortMvnPath;
174176
process.env['VSCEXT_EXHORT_PREFER_MVNW'] = this.exhortPreferMvnw;
177+
process.env['VSCEXT_EXHORT_MVN_ARGS'] = this.exhortMvnArgs;
175178
process.env['VSCEXT_EXHORT_GRADLE_PATH'] = this.exhortGradlePath;
176179
process.env['VSCEXT_EXHORT_PREFER_GRADLEW'] = this.exhortPreferGradlew;
177180
process.env['VSCEXT_EXHORT_NPM_PATH'] = this.exhortNpmPath;

src/dependencyAnalysis/analysis.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ async function executeComponentAnalysis(diagnosticFilePath: Uri, provider: IDepe
160160
'EXHORT_PIP_USE_DEP_TREE': globalConfig.usePipDepTree,
161161
'EXHORT_MVN_PATH': globalConfig.exhortMvnPath,
162162
'EXHORT_PREFER_MVNW': globalConfig.exhortPreferMvnw,
163+
'EXHORT_MVN_ARGS': globalConfig.exhortMvnArgs,
163164
'EXHORT_GRADLE_PATH': globalConfig.exhortGradlePath,
164165
'EXHORT_NPM_PATH': globalConfig.exhortNpmPath,
165166
'EXHORT_YARN_PATH': globalConfig.exhortYarnPath,

src/stackAnalysis.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export async function executeStackAnalysis(manifestFilePath: string, outputChann
3030
'EXHORT_PIP_USE_DEP_TREE': globalConfig.usePipDepTree,
3131
'EXHORT_MVN_PATH': globalConfig.exhortMvnPath,
3232
'EXHORT_PREFER_MVNW': globalConfig.exhortPreferMvnw,
33+
'EXHORT_MVN_ARGS': globalConfig.exhortMvnArgs,
3334
'EXHORT_GRADLE_PATH': globalConfig.exhortGradlePath,
3435
'EXHORT_PREFER_GRADLEW': globalConfig.exhortPreferGradlew,
3536
'EXHORT_NPM_PATH': globalConfig.exhortNpmPath,

0 commit comments

Comments
 (0)