简体   繁体   English

将参数传递给下游Maven作业?

[英]Passing parameters to a downstream maven job?

With the Jenkins plugin "Parameterized Trigger Plugin" you can pass job parameters to a downstream job. 使用Jenkins插件“ Parameterized Trigger Plugin”,您可以将作业参数传递给下游作业。 You have to specify the downstream job which I don't know in my case. 您必须指定我不知道的下游作业。

In am using all maven jobs with the setting "Build whenever a SNAPSHOT dependency is built" enabled such that the downstream jobs are automatically detected and run by Jenkins it self. 在使用设置为“每当构建SNAPSHOT依赖项时生成”的所有maven作业时,Jenkins会自动检测并运行下游作业。 A such, I don't know the downstream job such that I can't specify it when using the "Parameterized Trigger Plugin". 这样的话,我不知道下游作业,因此在使用“参数化触发器插件”时无法指定它。 How can I pass all parameters value's to all the detected jenkins maven jobs? 如何将所有参数值传递给所有检测到的jenkins maven作业?

Sorry, but I have to disappoint you. 抱歉,但我必须让您失望。 There is no way to add parameters to the Build whenever a SNAPSHOT dependency is built . Build whenever a SNAPSHOT dependency is built无法向Build whenever a SNAPSHOT dependency is built添加参数。 There is a little manual work to do to "add this functionality": 有一些手动工作可以“添加此功能”:

  • Go to the triggered Job with parameter 使用参数转到已触发的作业
  • Go to each Upstream-Job and add a post build action: Trigger parameterized build on other projects 转到每个Upstream-Job并添加后期构建操作: Trigger parameterized build on other projects

Its not the ideal solution. 它不是理想的解决方案。 But the plugin doesn't support this use case. 但是该插件不支持此用例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM