问题描述
我对Jenkins管道非常陌生,并尝试在管道中编写一些Groovy脚本.现在,我使用声明性管道并在Jenkins UI本身中编写Groovy代码,这不利于对象上方法的自动填充,自动导入等.
I'm very new to Jenkins pipeline and trying to write some Groovy scripts in pipeline. Now, I'm using declarative pipeline and writing Groovy code in Jenkins UI itself which is not helping with auto-population of methods on objects, auto-import etc.
通常,当我们使用诸如eclipse,Intellij Idea这样的IDE进行Java编程时,我们可以看到相应的导入会自动添加到代码中,并且也支持自动提示.
Generally when we use IDE like eclipse, Intellij Idea for Java programming, we can see respective imports are automatically added in the code and also autosuggestion is supported.
我如何才能有效地对Jenkins管道进行通用编码,从而节省时间并帮助自动建议方法,导入,编译错误等?
How can I groovy code effectively for Jenkins pipeline which would save my time and help with autom-suggestion of methods, imports, compilation error etc?
推荐答案
我已经使用此设置.
需要说明的是,我使用的是脚本化管道,并且该设置还用于詹金斯的钩子和 Jenkins共享库.
The caveat is that I'm using scripted pipeline and the setup is also used for Groovy scripts for Jenkins hooks and Jenkins shared library.
这篇关于如何有效地为詹金斯管道开发Groovy脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!