-
Type:
Bug
-
Resolution: Not A Defect
-
Priority:
Minor
-
Component/s: core
-
Environment:2.89.4 (lts)
FilePath.installIfNecessaryFrom, used from ZipExtractionInstaller, is designed to check if target already exists before downloading from remote URL.Â
But I observe that every time I run the build job, the tool is downloaded from remote URL even if the files exists in local $JENKINS_HOME/tools directory.
No exception raised while processing.
Â
Simple test pipeline to reproduce issue:
pipeline {
agent any
tools {
maven "M3"
jdk "JDK8_161"
}
stages {
stage('Test') {
steps {
echo 'Testing..'
}
}
}
}
*Job output logs for this example *:
[Pipeline] node
Running on Jenkins in /var/jenkins_home/workspace/test
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Tool Install)
[Pipeline] tool
[Pipeline] envVarsForTool
[Pipeline] tool
Unpacking https://<repo>.box.com/shared/static/rczslq4dc79l3ylhuoxhlje4kiu2iu7o.gz to /var/jenkins_home/tools/hudson.model.JDK/JDK8_161 on Jenkins
[Pipeline] envVarsForTool
Unpacking https://<repo>.box.com/shared/static/rczslq4dc79l3ylhuoxhlje4kiu2iu7o.gz
to /var/jenkins_home/tools/hudson.model.JDK/JDK8_161 on Jenkins
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Test)
[Pipeline] tool
[Pipeline] envVarsForTool
[Pipeline] tool
Unpacking https://<repo>.box.com/shared/static/rczslq4dc79l3ylhuoxhlje4kiu2iu7o.gz
to /var/jenkins_home/tools/hudson.model.JDK/JDK8_161 on Jenkins
[Pipeline] envVarsForTool
Unpacking https://<repo>.box.com/shared/static/rczslq4dc79l3ylhuoxhlje4kiu2iu7o.gz
to /var/jenkins_home/tools/hudson.model.JDK/JDK8_161 on Jenkins
[Pipeline] withEnv
[Pipeline] {
[Pipeline] echo
Testing..
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
Tools auto-installer configuration :
- M3 : MavenInstaller("3.5.2")
- JDK8_161 : ZipExtractionInstaller("", "https://<repo>.box.com/shared/static/rczslq4dc79l3ylhuoxhlje4kiu2iu7o.gz", "jdk1.8.0_161")
Â
We can see that M3 is not downloaded because it's already existing in $JENKINS_HOME/tools.Â
But JDK8_161 is downloaded every time I run the job.