You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "slachiewicz (via GitHub)" <gi...@apache.org> on 2026/09/21 11:16:10 UTC
[I] EmbeddedMavenExecutor restores a constructor-time System snapshot after every run [maven-executor]
slachiewicz opened a new issue, #46:
URL: https://github.com/apache/maven-executor/issues/46
### Affected version
1.0.0
### Bug description
`EmbeddedMavenExecutor` copies `System.getProperties()` once, in its constructor ([EmbeddedMavenExecutor.java:128-129](https://github.com/apache/maven-executor/blob/main/maven-executor/src/main/java/org/apache/maven/executor/embedded/EmbeddedMavenExecutor.java)), together with `System.out` and `System.err`, and restores that same snapshot in the `finally` block of every `execute()` (`:159-162`). Any change a caller makes to system properties between two executions on one long-lived executor is silently reverted after the next run. maven-verifier's `Embedded3xLauncher` snapshotted per run.
The pattern that triggers it is the natural one for a test fixture: one `ExecutorHelper` per JVM, reused across hundreds of integration tests, some of which set a system property to drive the next build. Found while porting `maven-surefire`'s IT fixture (apache/maven-surefire#3484); the fixture now creates one executor per `Verifier` instance to avoid it.
Proposal: take the snapshot at the start of each `execute()` rather than in the constructor. This is distinct from the thread-safety window in #16 item 8, which is about `System.setProperties(null)` during a run.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] EmbeddedMavenExecutor restores a constructor-time System snapshot after every run [maven-executor]
Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz closed issue #46: EmbeddedMavenExecutor restores a constructor-time System snapshot after every run
URL: https://github.com/apache/maven-executor/issues/46
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org