Complete the code to archive artifacts in a Jenkins job.
steps {
archiveArtifacts artifacts: '[1]'
}The pattern **/*.jar archives all JAR files in the workspace and subdirectories.
Complete the code to copy artifacts from another Jenkins job.
steps {
copyArtifacts(projectName: '[1]')
}The projectName parameter specifies the job to copy artifacts from, such as TestJob.
Fix the error in the code to copy artifacts from a specific build number.
steps {
copyArtifacts(projectName: 'BuildJob', selector: [1])
}The specific('5') selector copies artifacts from the specific build number 5.
Fill both blanks to copy artifacts from a job named 'DeployJob' and only include files matching '*.war'.
steps {
copyArtifacts(projectName: '[1]', filter: '[2]')
}The projectName should be 'DeployJob' and the filter '*.war' to copy WAR files only.
Fill all three blanks to archive all JAR files, then copy artifacts from 'BuildJob' filtering '*.jar' files.
pipeline {
stages {
stage('Archive') {
steps {
archiveArtifacts artifacts: '[1]'
}
}
stage('Copy') {
steps {
copyArtifacts(projectName: '[2]', filter: '[3]')
}
}
}
}Use **/*.jar to archive all JAR files, copy from BuildJob, and filter with *.jar.