How do you configure the Jenkins “Create Job Advanced” plugin via groovy?

后端 未结 2 1194
星月不相逢
星月不相逢 2021-01-07 07:01

My main goal is to use groovy to configure Jenkins and all the plugins, so that I don\'t need to manually configure Jenkins through the web interface, as the the post here w

2条回答
  •  盖世英雄少女心
    2021-01-07 07:35

    The CreateJobAdvancedPlugin class seems to have no Descriptor. You need to get the plugin instance from the PluginManager instead, e.g.

    import hudson.PluginWrapper
    import hudson.plugins.createjobadvanced.CreateJobAdvancedPlugin
    import jenkins.model.Jenkins
    
    PluginWrapper wrapper = Jenkins.instance.pluginManager.getPlugin(CreateJobAdvancedPlugin)
    CreateJobAdvancedPlugin plugin = wrapper.getPlugin() as CreateJobAdvancedPlugin
    

提交回复
热议问题