Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does jenkins determine which local repository to use?

I have two jobs running in jenkins both have the following setup enter image description here

the global settings are

enter image description here

when they run they use the commands

Executing Maven:  -B -f /u01/jenkins/jobs/job_1/workspace/pom.xml -Dmaven.repo.local=/u01/jenkins/maven-repositories/0 clean install

Executing Maven:  -B -f /u01/jenkins/jobs/job_2/workspace/pom.xml -Dmaven.repo.local=/u01/jenkins/maven-repositories/1 clean install

Why do they use different repositories?

job 2 is dependent on an artifact produced by job 1.

like image 870
BevynQ Avatar asked Jun 08 '14 23:06

BevynQ


1 Answers

When local maven repository is set to Local to the executer then the 1 in -Dmaven.repo.local=/u01/jenkins/maven-repositories/1 refers to the executer the job is running in. So if the job is running in executer n then the argument will be -Dmaven.repo.local=/u01/jenkins/maven-repositories/n.

like image 57
BevynQ Avatar answered Nov 09 '22 05:11

BevynQ