feat(run): Add VM options to Java run configurations (#206)

Adds Application and Spring Boot run configuration types with main class, VM options, program arguments, classpath and active profiles. Maven passes them through spring-boot.run.jvmArguments / profiles / argLine; Gradle through an init script.

Fixes #187

Claude-Session: https://claude.ai/code/session_01Dq6jQQn8ZhRfkkyj3PRutA
This commit is contained in:
l0ng-ai authored and GitHub committed 2026-10-29 11:39:20 +08:00
1 parent ed7b0f88ef
commit 8ebeaa2663
15 files changed
+690 -8

No files matched your search

@@ -75,6 +75,23 @@ describe("Java debugging (java-debug through jdtls)", () => {
});
});
it("passes the configuration's VM options to java-debug's vmArgs, before the main class", async () => {
const args = [
"-Ddemo.flag=on",
"--add-opens",
"java.base/java.lang=ALL-UNNAMED",
"-Dname=a b",
"-cp",
"${classpath}",
];
const l = await javaLaunchConfig({ ...app, args: [...args, "a.App", "--spring.profiles.active=dev"] }, "/p");
expect(JSON.parse(l.extraJson!)).toMatchObject({
mainClass: "a.App",
vmArgs: '-Ddemo.flag=on --add-opens java.base/java.lang=ALL-UNNAMED "-Dname=a b"',
args: "--spring.profiles.active=dev",
});
});
it("lets java-debug shorten a classpath too long for the OS, as Run does", async () => {
for (const how of ["jarmanifest", "argfile"]) {
shortenCommandLine = how;