Skip to content

Capture embedded executor properties per execution - #53

Open
efegokdemir wants to merge 1 commit into
apache:mainfrom
efegokdemir:codex/46-per-execution-system-snapshot
Open

efegokdemir wants to merge 1 commit into
apache:mainfrom
efegokdemir:codex/46-per-execution-system-snapshot

Conversation

@efegokdemir

Copy link
Copy Markdown

Summary

Fixes #46 by snapshotting system properties when each embedded Maven execution begins. Reusable executors now preserve caller changes made between executions instead of restoring a constructor-time snapshot.

Changes

  • Capture the system-properties snapshot at the start of EmbeddedMavenExecutor.execute().
  • Add a regression test that replaces the system-properties object between two executions.

Testing

  • JAVA_HOME=/opt/homebrew/opt/openjdk@21 mvn -pl maven-executor -Dtest=EmbeddedMavenExecutorTest#preservesSystemPropertiesSetBetweenExecutions test — PASS.
  • The regression test failed before the production change with the expected missing property, then passed after the change.
  • JAVA_HOME=/opt/homebrew/opt/openjdk@21 mvn -pl maven-executor -DskipTests verify — PASS.
  • JAVA_HOME=/opt/homebrew/opt/openjdk@21 mvn -pl maven-executor test — 60 passed, 1 existing baseline failure in defaultFs4CaptureOutputWithForcedColor; the same failure reproduces on the unmodified main branch.
  • git diff --check — PASS.

Notes

No competing open PR was found for #46 during the final duplicate check. AI assistance was used; the submitter has reviewed the complete diff and is responsible for the change.

Snapshot system properties when an execution begins so a reusable embedded executor preserves caller changes made between runs. Add a regression test covering a replaced system properties object.

Co-authored-by: Codex <[email protected]>
Signed-off-by: Efe Gökdemir <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EmbeddedMavenExecutor restores a constructor-time System snapshot after every run

1 participant