How can we upload a groovy file from a local machine to the jenkins instance - workspace as the following reports the error within a FreeStyle project "ERROR: (script, line 81) File backupPOM.groovy does not exist in workspace" ?
mavenJob('check-bom-dependencies') {
description 'Maven Job checking the BOM dependencies of the Spring Boot project'
logRotator {
numToKeep 3
}
parameters {
stringParam('TAG', '2.3.4.Final',
'The release version for the artifact. If you leave this empty, ' +
'the current SNAPSHOT version will be used with the ' +
'"-SNAPSHOT" suffix removed (example: if the current version ' +
'is "1.0-SNAPSHOT", the release version will be "1.0").')
}
scm {
git {
remote {
branch '$TAG'
}
}
}
preBuildSteps {
groovyCommand(readFileFromWorkspace('backupPOM.groovy')) {
groovyInstallation('groovy3')
}
}
rootPOM 'pom.xml'
goals '-B dependency:tree'
}