Csa*_*agó 6 pom.xml maven jenkins
我想为 Jenkins 作业添加一个选择参数。该列表是固定的,但我希望 Dropbox 显示自定义值,而不是实际值(类似于网页名称而不是其 URL)。
在某些情况下,这是pom.xml文件的路径,但是,我想显示模块名称而不是完整路径。一个例子:
Actual value | What I want to be displayed
-------------------------------------|----------------------------
full/path/to/my/modules/pom.xml | All modules
full/path/to/my/modules/util/pom.xml | Utilities
full/path/to/my/modules/data/pom.xml | Data handling
Run Code Online (Sandbox Code Playgroud)
我在这里先向您的帮助表示感谢!
使用Active Choices插件,您可以使用 groovy 地图进行设置:
使用以下 groovy 脚本设置“Active Choices Parameter”:
return['full/path/to/my/modules/pom.xml' : 'All modules',
'full/path/to/my/modules/util/pom.xml' : 'Utilities',
'full/path/to/my/modules/data/pom.xml' : 'Data handling']
Run Code Online (Sandbox Code Playgroud)
地图的“key”将被设置在变量中:
> echo "$URL"
full/path/to/my/modules/pom.xml
Run Code Online (Sandbox Code Playgroud)