maven - groovy.lang.MissingPropertyException: No such property: manager for class: Script1 -
i trying invoke groovy inside hudson (using groovy plugin) properties our build. getting exception:
groovy.lang.missingpropertyexception: no such property: manager class: script1
i following line:
def buildnumber = manager.build.number
this happens when run inline command within jenkins using script:
i tried solution below, fails during declaration (line two):
binding binding = new binding(); binding.setvariable("manager", manager); groovyshell shell = new groovyshell(binding); shell.evaluate(new file("d:/dev/others/hudson/usercontent/scriptstuff.groovy").text);
the above run using: groovy command. , when run build errors , complains line - binding.setvariable("manager", manager);
when use groovy script file, complains about:
def buildnumber = manager.build.number
both errors : groovy.lang.missingpropertyexception: no such property: manager class: script1
tried mentioned in thread well:
i using hudson 2.2.1 , groovy 2.1.3. wrong?
maybe i'm missing part of code, define manager? if that's complete groovy script, you're trying bind variable isn't declared anything, it's not weird fails, right?
just define manager that's want, like:
def manager = "my manager" // not want
and should should rid of current error.
Comments
Post a Comment