You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "olamy (via GitHub)" <gi...@apache.org> on 2026/03/13 04:04:27 UTC

[PR] Avoid some non thread safety issue with local repo here using system properties, add a way to configure the local repo via a new builder [maven-verifier]

olamy opened a new pull request, #195:
URL: https://github.com/apache/maven-verifier/pull/195

   Signed-off-by: Olivier Lamy <ol...@apache.org>
   
   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
   - [ ] Your pull request should address just one issue, without pulling in other changes.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
     Note that commits might be squashed by a maintainer on merge.
   - [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
     This may not always be possible but is a best-practice.
   - [ ] Run `mvn verify` to make sure basic checks pass.
     A more thorough check will be performed on your pull request automatically.
   - [ ] You have run the integration tests successfully (`mvn -Prun-its verify`).
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
   - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   


-- 
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


Re: [PR] Avoid some non thread safety issue with local repo here using system properties, add a way to configure the local repo via a new builder [maven-verifier]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz commented on PR #195:
URL: https://github.com/apache/maven-verifier/pull/195#issuecomment-5850012244

   Closing without merging: maven-verifier is being retired (vote result: https://lists.apache.org/thread/ctmrr59cq7kxclqz3yf1om1s3crprhcs), and 2.0.0 will be its final release. The migration target is maven-executor. Its forked mode never touches JVM system properties, so parallel builds don't race on `maven.repo.local`. Its embedded mode sets the system properties for each run, so the same race applies there; use forked mode for parallel tests. Thanks for the fix, Olivier.


-- 
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


Re: [PR] Avoid some non thread safety issue with local repo here using system properties, add a way to configure the local repo via a new builder [maven-verifier]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz closed pull request #195: Avoid some non thread safety issue with local repo here using system properties, add a way to configure the local repo via a new builder
URL: https://github.com/apache/maven-verifier/pull/195


-- 
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


Re: [PR] Avoid some non thread safety issue with local repo here using system properties, add a way to configure the local repo via a new builder [maven-verifier]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on code in PR #195:
URL: https://github.com/apache/maven-verifier/pull/195#discussion_r2929653199


##########
src/main/java/org/apache/maven/shared/verifier/Verifier.java:
##########
@@ -327,6 +327,62 @@ public Verifier(String basedir, String settingsFile, boolean debug, String maven
         setMavenHome(mavenHome);
     }
 
+    /**
+     * Builder for creating {@link Verifier} instances with explicit configuration.
+     * <p>
+     * When {@link #localRepository(String)} is set, the local repository is pre-populated
+     * before {@code findLocalRepo()} runs, so the system property
+     * {@code maven.repo.local} is never consulted. This eliminates the race condition that
+     * occurs when multiple {@code Verifier} instances are constructed concurrently in the
+     * same JVM while {@link Embedded3xLauncher#run} is manipulating the JVM-global system
+     * properties table ({@code System.setProperties(null)}).
+     */
+    public static class Builder {
+        private final String basedir;
+        private String settingsFile;
+        private String localRepository;

Review Comment:
   I would like to add also `forkMode` and `forkJvm` to builder



-- 
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


Re: [PR] Avoid some non thread safety issue with local repo here using system properties, add a way to configure the local repo via a new builder [maven-verifier]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz commented on PR #195:
URL: https://github.com/apache/maven-verifier/pull/195#issuecomment-5551525351

   _This project is deprecated. [maven-executor](https://github.com/apache/maven-executor) is released and moved to its own repository._


-- 
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