diff --git a/vscode-extensions/vscode-spring-boot/lib/debug-config-provider.ts b/vscode-extensions/vscode-spring-boot/lib/debug-config-provider.ts index 942b532956..4599476a66 100644 --- a/vscode-extensions/vscode-spring-boot/lib/debug-config-provider.ts +++ b/vscode-extensions/vscode-spring-boot/lib/debug-config-provider.ts @@ -6,6 +6,7 @@ import psList from 'ps-list'; import { ListenablePreferenceSetting } from "@pivotal-tools/commons-vscode/lib/launch-util"; const JMX_VM_ARG = '-Dspring.jmx.enabled=' +const ACTUATOR_JMX_EXPOSURE_ARG = '-Dmanagement.endpoints.jmx.exposure.include=' const ADMIN_VM_ARG = '-Dspring.application.admin.enabled=' const BOOT_PROJECT_ARG = '-Dspring.boot.project.name='; const RMI_HOSTNAME = '-Djava.rmi.server.hostname=localhost'; @@ -23,6 +24,9 @@ class SpringBootDebugConfigProvider implements DebugConfigurationProvider { if (debugConfiguration.vmArgs.indexOf(JMX_VM_ARG) < 0) { debugConfiguration.vmArgs += ` ${JMX_VM_ARG}true`; } + if (debugConfiguration.vmArgs.indexOf(ACTUATOR_JMX_EXPOSURE_ARG) < 0) { + debugConfiguration.vmArgs += ` ${ACTUATOR_JMX_EXPOSURE_ARG}*`; + } if (debugConfiguration.vmArgs.indexOf(ADMIN_VM_ARG) < 0) { debugConfiguration.vmArgs += ` ${ADMIN_VM_ARG}true`; } @@ -33,7 +37,7 @@ class SpringBootDebugConfigProvider implements DebugConfigurationProvider { debugConfiguration.vmArgs += ` ${RMI_HOSTNAME}`; } } else { - debugConfiguration.vmArgs = `${JMX_VM_ARG}true ${ADMIN_VM_ARG}true ${BOOT_PROJECT_ARG}${debugConfiguration.projectName} ${RMI_HOSTNAME}`; + debugConfiguration.vmArgs = `${JMX_VM_ARG}true ${ACTUATOR_JMX_EXPOSURE_ARG}* ${ADMIN_VM_ARG}true ${BOOT_PROJECT_ARG}${debugConfiguration.projectName} ${RMI_HOSTNAME}`; } } return debugConfiguration;