Re: Named Lock implementation for Maven with Jenkins

2022-06-21 Thread Oliver B. Fischer
Hi, Am 21.06.22 um 22:31 schrieb mfriedenha...@gmx.de: I have made no experience. We do our Maven builds in Docker containers, the .m2 directory is prefilled in the image will all dependencies managed in our company pom, which is used by most of our applications because we ran into problems w

Re: Re: Named Lock implementation for Maven with Jenkins

2022-06-21 Thread mfriedenhagen
Hi Konrad, I have made no experience. We do our Maven builds in Docker containers, the .m2 directory is prefilled in the image will all dependencies managed in our company pom, which is used by most of our applications because we ran into problems with shared repositories. Before we used the sh

Re: Named Lock implementation for Maven with Jenkins

2022-06-21 Thread Tamás Cservenák
Actually, maven daemon since 0.8.0 uses file-lock to protect shared local repository from multiple daemon accesses. T On Tue, Jun 21, 2022 at 12:36 PM Tamás Cservenák wrote: > Correct, file-lock does work cross-VM, > > T > > On Tue, Jun 21, 2022 at 12:01 PM Konrad Windszus wrote: > >> Hi Mirko

Re: Named Lock implementation for Maven with Jenkins

2022-06-21 Thread Tamás Cservenák
Correct, file-lock does work cross-VM, T On Tue, Jun 21, 2022 at 12:01 PM Konrad Windszus wrote: > Hi Mirko, > Right, but isn’t “file-lock” relying internally on > https://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileLock.html > which says: "This file-locking API is intended to map d

Re: Named Lock implementation for Maven with Jenkins

2022-06-21 Thread Konrad Windszus
Hi Mirko, Right, but isn’t “file-lock” relying internally on https://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileLock.html which says: "This file-locking API is intended to map directly to the native locking facility of the underlying operating system. Thus the locks held on a file

Re: Re: Named Lock implementation for Maven with Jenkins

2022-06-21 Thread mfriedenhagen
Hi Konrad, citing the linked web site: "Local named locks are only suited within one JVM with a multithreaded build. Sharing a local repository between multiple Maven processes (i.e., on a busy CI server) requires a distributed named lock!" Best Regards Mirko Friedenhagen — Sent from my mobil

Re: Named Lock implementation for Maven with Jenkins

2022-06-21 Thread Konrad Windszus
Thanks for that suggestion. I know about that workaround. But to speed up builds and to reduce disk space usage I would really like to use a shared repo. I was wondering if there is any experience with the simple "file-lock” [1]. That has the advantage that it doesn’t need additional libraries (

Re: Named Lock implementation for Maven with Jenkins

2022-06-21 Thread Lasse Lindqvist
Hi. If you want to have pipeline build safely, you also have an alternative. With the withMaven clause (Pipeline Maven Integration Plugin) you can use something like *withMaven(maven: 'Maven123', mavenLocalRepo: '$WORKSPACE/../../.m2/$EXECUTOR_NUMBER/repository') { // Run my Maven commands here*