这一定是一个简单的菜鸟错误,但是
def hi = hudson.model.Hudson.instance hi.getItems(hudson.model.Project).each {project -> println(project.displayName) def di = project.getDownstreamProjects println(di.name) }
刚回来
groovy.lang.MissingPropertyException: No such property: getDownstreamProjects for class: hudson.model.FreeStyleProject
但是医生说该方法存在于AbstractProject上,我该怎么办?
你忘了()之后getDownstreamProjects。这是一种方法,而不是一种属性;-)
()
getDownstreamProjects