diff --git a/src/javaServerStarter.ts b/src/javaServerStarter.ts index 1b01b9437a..34ba23da76 100644 --- a/src/javaServerStarter.ts +++ b/src/javaServerStarter.ts @@ -19,12 +19,20 @@ const DEBUG = (typeof v8debug === 'object') || startedInDebugMode(); /** * Argument that tells the program where to generate the heap dump that is created when an OutOfMemoryError is raised and `HEAP_DUMP` has been passed */ - export const HEAP_DUMP_LOCATION = '-XX:HeapDumpPath='; +export const HEAP_DUMP_LOCATION = '-XX:HeapDumpPath='; - /** - * Argument that tells the program to generate a heap dump file when an OutOfMemoryError is raised - */ - export const HEAP_DUMP = '-XX:+HeapDumpOnOutOfMemoryError'; +/** + * Argument that tells the program to generate a heap dump file when an OutOfMemoryError is raised + */ +export const HEAP_DUMP = '-XX:+HeapDumpOnOutOfMemoryError'; + +/** + * Argument that specifies name of the dependency collector implementation to use. + * `df` for depth-first and `bf` for breadth-first. + * See: https://github.com/apache/maven-resolver/blob/maven-resolver-1.9.7/src/site/markdown/configuration.md + */ +const DEPENDENCY_COLLECTOR_IMPL= '-Daether.dependencyCollector.impl='; +const DEPENDENCY_COLLECTOR_IMPL_BF= 'bf'; export function prepareExecutable(requirements: RequirementsData, workspacePath, javaConfig, context: ExtensionContext, isSyntaxServer: boolean): Executable { const executable: Executable = Object.create(null); @@ -130,6 +138,9 @@ function prepareParams(requirements: RequirementsData, javaConfiguration, worksp if (vmargs.indexOf(HEAP_DUMP_LOCATION) < 0) { params.push(`${HEAP_DUMP_LOCATION}${path.dirname(workspacePath)}`); } + if (vmargs.indexOf(DEPENDENCY_COLLECTOR_IMPL) < 0) { + params.push(`${DEPENDENCY_COLLECTOR_IMPL}${DEPENDENCY_COLLECTOR_IMPL_BF}`); + } const sharedIndexLocation: string = resolveIndexCache(context); if (sharedIndexLocation) {