Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions rust/lithe-core/src/execution/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ pub fn create_launch_plan(request: LaunchPlanRequest) -> Result<Value, CoreError
if request.maven_context.is_none() {
arguments.extend([json!("-B"), json!("-ntp")]);
if let Some(module) = maven["module"].as_str().filter(|m| *m != ".") {
arguments.extend([json!("-pl"), json!(module)]);
arguments.extend([json!("-pl"), json!(module), json!("-am")]);
}
}
let main = maven["mainClass"].as_str().ok_or_else(|| {
Expand Down Expand Up @@ -1525,7 +1525,7 @@ pub fn create_launch_plan(request: LaunchPlanRequest) -> Result<Value, CoreError
if request.maven_context.is_none() {
arguments.extend([json!("-B"), json!("-ntp")]);
if let Some(module) = maven["module"].as_str().filter(|m| *m != ".") {
arguments.extend([json!("-pl"), json!(module)]);
arguments.extend([json!("-pl"), json!(module), json!("-am")]);
}
if let Some(profiles) = maven["profiles"].as_array().filter(|p| !p.is_empty()) {
arguments.extend([
Expand Down Expand Up @@ -1593,7 +1593,7 @@ pub fn create_launch_plan(request: LaunchPlanRequest) -> Result<Value, CoreError
context,
module,
trailing_arguments,
false,
true,
)?;
arguments = shared_plan
.arguments
Expand Down
14 changes: 8 additions & 6 deletions rust/lithe-core/src/tests/detectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,7 @@ fn framework_launch_plans_use_each_goal_s_own_property_names() {
"-ntp",
"-pl",
"api",
"-am",
"-Djvm.args=-Xmx2g",
"-Dquarkus.args=--dev",
"quarkus:dev"
Expand All @@ -1397,6 +1398,7 @@ fn framework_launch_plans_use_each_goal_s_own_property_names() {
"-ntp",
"-pl",
"api",
"-am",
"-Dmn.jvmArgs=-Xmx2g",
"-Dmn.appArgs=--dev",
"mn:run"
Expand All @@ -1407,20 +1409,20 @@ fn framework_launch_plans_use_each_goal_s_own_property_names() {
// into the JVM arguments as well would leave two agents contending for one
// port, and the service would fail to bind rather than start.
let quarkus = arguments("quarkus", serde_json::json!(5005));
assert_eq!(quarkus[4], "-Djvm.args=-Xmx2g");
assert_eq!(quarkus[6], "-Ddebug=5005");
assert_eq!(quarkus[5], "-Djvm.args=-Xmx2g");
assert_eq!(quarkus[7], "-Ddebug=5005");
// Suspend so a breakpoint in initialisation is still reachable: Quarkus dev
// mode does not suspend by default.
assert_eq!(quarkus[7], "-Dsuspend=y");
assert_eq!(quarkus[8], "-Dsuspend=y");
assert!(
!quarkus.to_string().contains("agentlib:jdwp"),
"{quarkus:?}"
);

let micronaut = arguments("micronaut", serde_json::json!(5005));
assert_eq!(micronaut[6], "-Dmn.debug=true");
assert_eq!(micronaut[7], "-Dmn.debug.port=5005");
assert_eq!(micronaut[8], "-Dmn.debug.suspend=true");
assert_eq!(micronaut[7], "-Dmn.debug=true");
assert_eq!(micronaut[8], "-Dmn.debug.port=5005");
assert_eq!(micronaut[9], "-Dmn.debug.suspend=true");
assert!(
!micronaut.to_string().contains("agentlib:jdwp"),
"{micronaut:?}"
Expand Down
8 changes: 5 additions & 3 deletions rust/lithe-core/src/tests/run_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ fn run_configuration_generation_uses_a_maven_project_below_the_workspace() {
assert_eq!(plan["ok"], true, "{plan}");
assert_eq!(plan["data"]["workingDirectory"], "projects/demo");
assert_eq!(
&plan["data"]["arguments"].as_array().unwrap()[..11],
&plan["data"]["arguments"].as_array().unwrap()[..12],
[
"-B",
"-ntp",
Expand All @@ -250,12 +250,13 @@ fn run_configuration_generation_uses_a_maven_project_below_the_workspace() {
"/local/settings.xml",
"-pl",
"service",
"-am",
"-DskipTests",
"-Dspring-boot.run.main-class=com.example.App",
"spring-boot:run"
]
);
assert!(!plan["data"]["arguments"]
assert!(plan["data"]["arguments"]
.as_array()
.unwrap()
.iter()
Expand Down Expand Up @@ -306,7 +307,7 @@ fn run_configuration_generation_uses_a_maven_project_below_the_workspace() {
.as_array()
.unwrap()
.iter()
.any(|argument| argument == "-am" || argument == "-DskipTests"));
.any(|argument| argument == "-DskipTests"));

let java_plan: Value = serde_json::from_str(&execute_json(
&serde_json::json!({
Expand Down Expand Up @@ -2274,6 +2275,7 @@ fn migrated_v1_documents_produce_identical_launch_arguments() {
"-ntp",
"-pl",
"backend",
"-am",
"-P",
"local",
"-Dspring-boot.run.main-class=com.example.App",
Expand Down
4 changes: 2 additions & 2 deletions shared/contracts/application-boundary.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,5 +337,5 @@ context. A Run Configuration's explicit Profiles and toolchain paths take
precedence; explicit `cwd` and `extensions.maven.skipTests` values also take
precedence, including `skipTests: false`. Unset values inherit the project
settings. The shared Core applies the final Maven argument order for all three
entry points. Tool-window module launches add `-am`; Run and Debug retain their
existing `-pl <module>` 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.
7 changes: 4 additions & 3 deletions shared/contracts/rust-core-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <module> -am`; Run and Debug plans use
`-pl <module>` without `-am`. Settings use `-s`; skipped tests use
from `maven.launchPlan` and Maven-backed Run and Debug plans use
`-pl <module> -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"-ntp",
"-pl",
"module-a",
"-am",
"-Dexec.mainClass=com.example.App",
"-Dexec.classpathScope=test",
"test-compile",
Expand All @@ -30,6 +31,7 @@
"-ntp",
"-pl",
"module-b",
"-am",
"-Dexec.mainClass=com.example.App",
"org.codehaus.mojo:exec-maven-plugin:3.5.0:java"
]
Expand Down
2 changes: 2 additions & 0 deletions shared/fixtures/execution/maven.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
"-ntp",
"-pl",
"api",
"-am",
"-Djvm.args=-Xmx2g",
"-Dquarkus.args=--dev",
"-Ddebug=5005",
Expand All @@ -215,6 +216,7 @@
"-ntp",
"-pl",
"api",
"-am",
"-Dmn.jvmArgs=-Xmx2g",
"-Dmn.appArgs=--dev",
"-Dmn.debug=true",
Expand Down
Loading