Jenkins SCM获取验证参数

时间:2016-11-21 12:50:42

标签: jenkins jenkins-plugins

我正在尝试编写一个Jenkins SCM插件。

Screenshot of SCM plugin

我需要验证参数(Test1,Test2)。

Test1取决于DIR字段。

Test2取决于DIR和Test1字段。

包含Test1& amp;的类Test2是一个可重复的属性。 Config.jelly正在关注`

<f:entry title="DIR" field="Dir">
    <f:textbox />
</f:entry>

<f:entry title="Variable" field="var">
    <f:textbox />
</f:entry>

<f:entry>
    <f:repeatableProperty field="directories" noAddButton="true" minimum="1"/>
</f:entry>

`

目录的

和Config.jelly正在关注

<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
    <f:entry title="Test1" field="test1">
      <f:textbox />
    </f:entry>

    <f:entry title="Test2" field="test2">
      <f:textbox />
    </f:entry>

    <f:entry>
        <div align="right">
        <input type="button" value="${%Add more workareas}..." class="repeatable-add show-if-last"/>
        <input type="button" value="${%Delete}" class="repeatable-delete show-if-not-only" style="margin-left: 1em;"/>
    </div>

如何获得用于验证Test1的DIR字段的值?我用了 public FormValidation doCheckTest1(@QueryParameter String value, @QueryParameter String Dir)

但我将Dir视为空。

1 个答案:

答案 0 :(得分:0)

我可以使用@RelativePath获取dir的值(&#34; ..&#34;)