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*
* }*
It will use the workspace folder, travel out of it to a parent location and
make a sibling .m2 folder and unique subfolder there based on the executor
number. This way the folders used are executor specific and there will be
no concurrency problems. The downside is that it will use more disk space
because many artifacts are stored multiple times.

ti 21. kesäk. 2022 klo 10.51 Konrad Windszus (k...@apache.org) kirjoitti:

> Hi,
> By default Jenkins uses a global Maven repository which is accessed in
> parallel by multiple jobs running in dedicated VMs. To prevent race
> conditions one should probably configure one of the distributed named locks
> outlined in
> https://maven.apache.org/resolver/maven-resolver-named-locks/index.html <
> https://maven.apache.org/resolver/maven-resolver-named-locks/index.html>.
> Is there any recommendation which one to pick and also some concrete hints
> how to set that up with Jenkins (Pipelines, leveraging
> https://www.jenkins.io/doc/pipeline/steps/pipeline-maven/ <
> https://www.jenkins.io/doc/pipeline/steps/pipeline-maven/>)
>
> Is ASF Jenkins using named locks already?
> Thanks for any pointers
>
> Konrad
>
>

Reply via email to