Where are Jenkins artifacts located?

JenkinsArtifacts

Jenkins Problem Overview


I added the Archive Artifacts post-build option to my project. I can see the artifacts from the web browser interface, but I cannot find them in the filesystem.

Where are they located?

Jenkins Solutions


Solution 1 - Jenkins

It is being archived on the master server (even if the build were on a slave) in the following folder:

$JENKINS_HOME/jobs/<job>/builds/<build>/archive

But you can configure a different location using the 'Advanced' setting of the job (where you can set a different workspace folder) or using plugins that are made for this purpose such as Copy Artifact Plugin

Solution 2 - Jenkins

Just another couple of tips...

You can find jenkins home by going to the environment variables page in the job build jenkins page.

Where to find Environment Variables

In my case JENKINS_HOME turned out to be /var/lib/jenkins

Found artifacts in:

/var/lib/jenkins/jobs/<my-job-name>-build/lastStable/archive/target

/var/lib/jenkins/jobs/<my-job-name>-build/lastSsuccessful/archive/target

as well as

/var/lib/jenkins/jobs/<my-job-name>-build/builds/8/archive/target

Solution 3 - Jenkins

Path is : $JENKINS_HOME/jobs//jobs//branches//builds/$BUILD_NUMBER/archive/

You have to extract branch name, job name and repository name from JOB_NAME environment variable.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVictorView Question on Stackoverflow
Solution 1 - JenkinsyorammiView Answer on Stackoverflow
Solution 2 - JenkinschimView Answer on Stackoverflow
Solution 3 - JenkinsNitulView Answer on Stackoverflow