From f8217cd90f91508e26e1dd47c7273d55eec03b01 Mon Sep 17 00:00:00 2001 From: lick <2188718831@qq.com> Date: Fri, 4 Sep 2026 21:42:51 +0800 Subject: [PATCH] fix(run): build Maven reactor dependencies --- .../RunConfigurationIntegrationTests.swift | 8 ++++---- rust/lithe-core/src/execution/configuration.rs | 6 +++--- rust/lithe-core/src/tests/detectors.rs | 14 ++++++++------ rust/lithe-core/src/tests/run_configuration.rs | 8 +++++--- shared/contracts/application-boundary.md | 4 ++-- shared/contracts/rust-core-api.md | 7 ++++--- .../execution/maven-java-main-source-sets-v1.json | 2 ++ shared/fixtures/execution/maven.json | 2 ++ 8 files changed, 30 insertions(+), 21 deletions(-) diff --git a/macos/Tests/LitheTests/RunConfigurationIntegrationTests.swift b/macos/Tests/LitheTests/RunConfigurationIntegrationTests.swift index 9ebb3d9e5..6ee67d3cb 100644 --- a/macos/Tests/LitheTests/RunConfigurationIntegrationTests.swift +++ b/macos/Tests/LitheTests/RunConfigurationIntegrationTests.swift @@ -3030,7 +3030,7 @@ struct RunConfigurationIntegrationTests { ) let plan = SharedLaunchPlan( executable: .toolchain("project-maven"), - arguments: ["-B", "-ntp", "-pl", "backend", "-P", "dev", "spring-boot:run"], + arguments: ["-B", "-ntp", "-pl", "backend", "-am", "-P", "dev", "spring-boot:run"], workingDirectory: "backend" ) let fixture = makeFixture( @@ -3133,12 +3133,12 @@ struct RunConfigurationIntegrationTests { ) let firstPlan = SharedLaunchPlan( executable: .toolchain("project-maven"), - arguments: ["-B", "-ntp", "-pl", "backend", "spring-boot:run"], + arguments: ["-B", "-ntp", "-pl", "backend", "-am", "spring-boot:run"], workingDirectory: "." ) let secondPlan = SharedLaunchPlan( executable: .toolchain("project-maven"), - arguments: ["-B", "-ntp", "-pl", "worker", "-P", "local", "spring-boot:run"], + arguments: ["-B", "-ntp", "-pl", "worker", "-am", "-P", "local", "spring-boot:run"], workingDirectory: "worker" ) let fixture = makeFixture( @@ -3190,7 +3190,7 @@ struct RunConfigurationIntegrationTests { ) let backendPlan = SharedLaunchPlan( executable: .toolchain("project-maven"), - arguments: ["-B", "-ntp", "-pl", "backend", "spring-boot:run"], + arguments: ["-B", "-ntp", "-pl", "backend", "-am", "spring-boot:run"], workingDirectory: "." ) let frontendPlan = SharedLaunchPlan( diff --git a/rust/lithe-core/src/execution/configuration.rs b/rust/lithe-core/src/execution/configuration.rs index a37862719..8508af92f 100644 --- a/rust/lithe-core/src/execution/configuration.rs +++ b/rust/lithe-core/src/execution/configuration.rs @@ -1468,7 +1468,7 @@ pub fn create_launch_plan(request: LaunchPlanRequest) -> Result Result Result` behavior without implicitly building dependencies. +entry points. Tool-window, Run, and Debug module launches add `-am` so reactor +dependencies are built before the selected module. diff --git a/shared/contracts/rust-core-api.md b/shared/contracts/rust-core-api.md index c57ae467f..39ca24f57 100644 --- a/shared/contracts/rust-core-api.md +++ b/shared/contracts/rust-core-api.md @@ -940,8 +940,8 @@ optional Maven/JDK paths used only for the configuration fingerprint. The response contains the `project-maven` toolchain reference, an argument array, the workspace-relative reactor working directory, and a deterministic SHA-256 configuration fingerprint. Profiles are sorted and de-duplicated. Module plans -from `maven.launchPlan` use `-pl -am`; Run and Debug plans use -`-pl ` without `-am`. Settings use `-s`; skipped tests use +from `maven.launchPlan` and Maven-backed Run and Debug plans use +`-pl -am`. Settings use `-s`; skipped tests use `-DskipTests`. Explicit Run `cwd`, Profiles, and `extensions.maven.skipTests` values override the project context, including `skipTests: false`. The core never reads `settings.xml` and never copies its path into a portable @@ -1059,7 +1059,8 @@ the resolved Run Configuration replace the context profiles; otherwise the project profiles are inherited. Explicit `extensions.maven.skipTests` and `cwd` values also replace the context values. Core applies the shared settings, module, Skip Tests, and reactor-working-directory rules to the generated -framework or Java-main arguments without adding tool-window-only `-am`. It +framework or Java-main arguments, including `-am` for selected reactor +modules. It returns a toolchain reference, argument array, project-relative working directory, and structured environment references. It does not return a shell command or platform diff --git a/shared/fixtures/execution/maven-java-main-source-sets-v1.json b/shared/fixtures/execution/maven-java-main-source-sets-v1.json index 5cfa8704d..680be3f7b 100644 --- a/shared/fixtures/execution/maven-java-main-source-sets-v1.json +++ b/shared/fixtures/execution/maven-java-main-source-sets-v1.json @@ -13,6 +13,7 @@ "-ntp", "-pl", "module-a", + "-am", "-Dexec.mainClass=com.example.App", "-Dexec.classpathScope=test", "test-compile", @@ -30,6 +31,7 @@ "-ntp", "-pl", "module-b", + "-am", "-Dexec.mainClass=com.example.App", "org.codehaus.mojo:exec-maven-plugin:3.5.0:java" ] diff --git a/shared/fixtures/execution/maven.json b/shared/fixtures/execution/maven.json index 7cbb00713..236a53562 100644 --- a/shared/fixtures/execution/maven.json +++ b/shared/fixtures/execution/maven.json @@ -194,6 +194,7 @@ "-ntp", "-pl", "api", + "-am", "-Djvm.args=-Xmx2g", "-Dquarkus.args=--dev", "-Ddebug=5005", @@ -215,6 +216,7 @@ "-ntp", "-pl", "api", + "-am", "-Dmn.jvmArgs=-Xmx2g", "-Dmn.appArgs=--dev", "-Dmn.debug=true",