Jenkins作业DSL配置块

Jenkins作业DSL配置块,jenkins,jenkins-plugins,jenkins-groovy,jenkins-job-dsl,Jenkins,Jenkins Plugins,Jenkins Groovy,Jenkins Job Dsl,我是Jenkins工作DSL的新手,正在尝试了解如何在DSL的scm部分使用配置块。我在Jenkins config.xml中有一个默认生成的部分 <scm class='hudson.plugins.git.GitSCM'> <browser class='hudson.plugins.git.browser.GithubWeb'> <url>https://github.com/repository/</url>

我是Jenkins工作DSL的新手,正在尝试了解如何在DSL的scm部分使用配置块。我在Jenkins config.xml中有一个默认生成的部分

<scm class='hudson.plugins.git.GitSCM'>
    <browser class='hudson.plugins.git.browser.GithubWeb'>
        <url>https://github.com/repository/</url>
    </browser>
</scm>
第12行是it语句

代码:

所以我不知道如何用代码修复这个问题

任何帮助都将不胜感激


谢谢。

在文档中,它说处理xml可能有点棘手,我认为应该是这样的(格式、内容不知道是不是这样):

javaposse.jobdsl.dsl.DslScriptException: (script, line 12) Ambiguous method overloading for method groovy.util.Node#div.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
scm {
        git {
            remote {
                github
                credentials
            }
            branch("refs/heads/master")
            configure {
                it / 'scm' / 'browser' {}
            }
        }
    }
it / scm / browser(class: 'hudson.plugins.git.browser.GithubWeb') / url('https://github.com/repository/')