@@ -31,6 +31,7 @@ export function debug(...messages: string[]) {
31
31
}
32
32
33
33
export interface MavenOptions extends legacyPlugin . BaseInspectOptions {
34
+ 'print-graph' ?: boolean ;
34
35
scanAllUnmanaged ?: boolean ;
35
36
allProjects ?: boolean ;
36
37
mavenAggregateProject ?: boolean ;
@@ -112,7 +113,7 @@ export async function inspect(
112
113
throw new Error ( 'Could not find file or directory ' + targetPath ) ;
113
114
}
114
115
if ( ! options ) {
115
- options = { dev : false , scanAllUnmanaged : false } ;
116
+ options = { dev : false , scanAllUnmanaged : false , 'print-graph' : false } ;
116
117
}
117
118
118
119
if ( targetPath && isArchive ( targetPath ) ) {
@@ -159,13 +160,17 @@ export async function inspect(
159
160
const mavenCommand = getCommand ( root , targetFile ) ;
160
161
const mvnWorkingDirectory = findWrapper ( mavenCommand , root , targetPath ) ;
161
162
const args = options . args || [ ] ;
163
+
162
164
const verboseEnabled =
163
- args . includes ( '-Dverbose' ) || args . includes ( '-Dverbose=true' ) ;
165
+ args . includes ( '-Dverbose' ) ||
166
+ args . includes ( '-Dverbose=true' ) ||
167
+ ! ! options [ 'print-graph' ] ;
168
+
164
169
const mvnArgs = buildArgs (
165
170
root ,
166
171
mvnWorkingDirectory ,
167
172
targetFile ,
168
- options . args ,
173
+ args ,
169
174
options . mavenAggregateProject ,
170
175
verboseEnabled ,
171
176
) ;
@@ -214,8 +219,8 @@ export async function inspect(
214
219
export function buildArgs (
215
220
rootPath : string ,
216
221
executionPath : string ,
217
- targetFile ? : string ,
218
- mavenArgs ? : string [ ] | undefined ,
222
+ targetFile : string | undefined ,
223
+ mavenArgs : string [ ] ,
219
224
mavenAggregateProject = false ,
220
225
verboseEnabled = false ,
221
226
) {
@@ -255,9 +260,15 @@ export function buildArgs(
255
260
}
256
261
}
257
262
258
- if ( mavenArgs ) {
259
- args = args . concat ( mavenArgs ) ;
263
+ if (
264
+ verboseEnabled &&
265
+ ! mavenArgs . includes ( '-Dverbose' ) &&
266
+ ! mavenArgs . includes ( '-Dverbose=true' )
267
+ ) {
268
+ args = args . concat ( '-Dverbose' ) ;
260
269
}
261
270
271
+ args = args . concat ( mavenArgs ) ;
272
+
262
273
return args ;
263
274
}
0 commit comments