I have a Jenkins job where as part of the build action I am executing a groovy script, say script A. From within script A I am trying to execute method of Test1. Both the files A.groovy and Test1.groovy are in the same directory.
I am getting "unable to resolve class"
error whenever I run the job.
A.groovy
println "****************** TEST : START *******************************"
println " Environment Variable value is : "
new Test1().printEnv()
println "****************** TEST : END *******************************"
I am using Groovy 2.3.6.
Test1.groovy
class Test1{
def printEnv(){
println "****************** TEST inside Test1.groovy : START *******************************"
println "****************** TEST inside Test1.groovy : END *******************************"
}
}
Error :
unable to resolve class Test1
NOTE : When I execute my script from outside jenkins then this works. Its only when I try to execute it through Jenkins that it is unable to find class Test1.
I am very much confused with this behavior.
There are many posts out there that discuss how to resolve the "unable to resolve class Test1"
error. but none seem to be applicable to my case as the call is fine when its made from outside the Jenkins.
I believe I have provided all the info I could. Still, please feel free to ask for more info, if the need arises.