feat(plugins): a granted plugin's Java agent joins Java run configurations (API 1.10) (#3830)

Plugins that instrument the user's application had no way to get a Java agent into the JVM the IDE starts. A [[contributes.javaAgents]] entry (one per plugin, a jar inside the package, optional single-line args, API ^1.10) derives the high-risk java.agent capability; granting it records the jar's blake3 hash, and every launch re-hashes the jar and leaves out a changed or missing one until approved again. For Application, Spring Boot and JAR Application run and debug, the host adds one -javaagent argument after the VM options (java-debug vmArgs, Kotlin vmArguments), never twice, and a shortened command line keeps it as its own argument. Remote projects and run targets get no agent, with one console line. Settings › Plugins shows the agent next to the permission.

Closes #3566

Co-authored-by: bertyhell <1710840+bertyhell@users.noreply.github.com>
This commit is contained in:
Bert Verhelst
2026-11-17 03:20:18 +08:00
committed by GitHub
co-authored by bertyhell
parent 6c9556ef54
commit 2b69d64055
28 changed files with 1023 additions and 12 deletions
+3
View File
@@ -13,6 +13,7 @@ import {
joinJavaArgs,
parseJavaArgs,
prepareJavaLaunch,
remoteJavaAgentNote,
type JavaPreparation,
} from "@/platform/javaLaunch";
import { maybeEditorService, notifications } from "@/workbench/contributions";
@@ -168,6 +169,8 @@ export async function javaLaunchConfig(
// java-debug starts the JVM itself, bypassing the Run process that echoes its
// command line. Echo the equivalent launch here so Debug and Run stay comparable.
preparation?.report?.(`${joinJavaArgs([resolved.command, ...resolved.args])}\n`);
const agentNote = await remoteJavaAgentNote(rc);
if (agentNote) preparation?.report?.(agentNote);
if (kotlin) {
return {
name: rc.name,