mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 08:03:19 +00:00
fix(run): resolve Java launches in attached projects (#5471)
Running or debugging a Java main class of a project attached to the window failed to compile (its Maven dependencies were missing): launch preparation used the primary project's root, build model, settings and cache. Run/Debug/test launches now resolve the owning attached project (innermost root containing the module) and use its build model, Maven reactor, settings, classpath and launch-snapshot cache; older saved configurations resolve the same way.
This commit is contained in:
@@ -140,7 +140,6 @@ export async function javaLaunchConfig(
|
||||
root: string,
|
||||
preparation?: JavaPreparation,
|
||||
): Promise<LaunchConfig> {
|
||||
const cwd = rc.cwd ? join(root, rc.cwd) : root;
|
||||
rc = await withEnvFiles(rc, root);
|
||||
const parsed = parseJavaArgs(rc.args);
|
||||
if (!parsed.mainClass) throw new Error(`No main class in '${rc.name}'`);
|
||||
@@ -155,6 +154,7 @@ export async function javaLaunchConfig(
|
||||
},
|
||||
},
|
||||
);
|
||||
const cwd = resolved.cwd ? join(root, resolved.cwd) : root;
|
||||
if (info.errorCount > 0 && !preparation?.report)
|
||||
notifications().notify({
|
||||
group: "run",
|
||||
|
||||
Reference in New Issue
Block a user