【发布时间】:2017-08-23 11:42:06
【问题描述】:
我正在尝试将 ClearCase UCM Plugin 合并到 Jenkins-Pipeline 中。目前,我正在使用 step-method 来调用 ClearCase-plugin:
step([
$class: 'hudson.plugins.clearcase.ClearCaseUcmSCM',
stream: "MY_STREAM",
loadrules: "load \\SOMETHING\\int load \\OTHER load \\RESOURCES",
[...]
changeset: "BRANCH",
viewStorage: null
])
据我了解插件系统的实例化是使用带有 @DataBoundConstructor 注释的构造函数完成的:
src/main/java/hudson/plugins/clearcase/ClearCaseUcmSCM.java:
@DataBoundConstructor
public ClearCaseUcmSCM(String stream, String loadrules, String viewTag, boolean usedynamicview, String viewdrive, String mkviewoptionalparam,
boolean filterOutDestroySubBranchEvent, boolean useUpdate, boolean rmviewonrename, String excludedRegions, String multiSitePollBuffer,
String overrideBranchName, boolean createDynView, boolean freezeCode, boolean recreateView, boolean allocateViewName, String viewPath,
boolean useManualLoadRules, ChangeSetLevel changeset, ViewStorage viewStorage, boolean buildFoundationBaseline) {
我从一个类似项目的 config.xml 文件中复制了大部分参数(布尔值、字符串、整数)。不幸的是,我得到一个例外: “java.lang.IllegalArgumentException:参数类型不匹配”
我猜是因为我无法创建“ChangeSetLevel”和“ViewStorage”(后者甚至不在 config.xml 中)。
所以我的问题是如何正确调用插件。
另外,我想知道如何正确传递“loadrules”,因为 config.xml 中似乎有换行符:
"load \\SOMETHING\\int[NEWLINE] load \\OTHER[NEWLINE] load \\RESOURCES"
【问题讨论】:
标签: jenkins jenkins-plugins jenkins-pipeline