Jenkins Job DSL 无法接受种子作业脚本中使用的任何 SVN 凭据

Jenkins Job DSL fails to accept any SVN credentials use in the seed job script

我第一次使用 Jenkins DSL 来创建一些种子作业。

我想在其中一个中使用一些 SVN 凭据,但无论我尝试什么,当我 运行 将凭据放入时,种子作业都无法创建新作业。DSL脚本在没有 SVN 凭据的情况下工作正常。

这是我的种子作业脚本中的相关片段:

            scm {
    svn {
    location(SVN_REPO_URL)
    credentials('23498723-hedy-4v73-76565-982734987234')
    }
}

请注意,我不确定我要为 "credentials so I have tried the credential ID as you see here, the name ("jenkins.mycompany/******")、描述 ("Jenkins SVN Credentials") 输入什么内容。我我还尝试将这些选项中的每一个都包装在单语音标记和双语音标记、括号、圆括号中。我不断收到此错误。

Building on master in workspace D:\data\jenkins\workspace\JobDSL
Disk space threshold is set to :5Gb
Checking disk space Now 
Total Disk Space Available is: 28Gb
 Node Name: master
Running Prebuild steps
Processing DSL script jobBuilder.groovy
ERROR: (jobBuilder.groovy, line 15) No signature of method: javaposse.jobdsl.dsl.helpers.scm.SvnContext.credentials() is applicable for argument types: (java.lang.String) values: [23498723-hedy-4v73-76565-982734987234]
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Finished: FAILURE

我不知道这是否与我几天前遇到的另一个问题有关,但我看不出任何明显的联系:

非常感谢任何帮助。

我使用的教程似乎有一些语法错误。我能够通过如下更改我的脚本来解决此问题。

  scm {
    svn {
      location(SVN_REPO_URL) {
        credentials('23498723-hedy-4v73-76565-982734987234')
      }
    }
}

现在可以了。