[英]Jenkins builds - parameterized maven goals
In Jenkins I have a "parameterized build". 在Jenkins,我有一个“参数化构建”。
I click "This build is parameterized". 我单击“此构建已参数化”。 Then add "Choice parameter":
然后添加“选择参数”:
SELECT_TARGET=install -DskipTests=true
SELECT_TARGET=install
SELECT_TARGET=clean install
in Build option - Goals and options : ${SELECT_TARGET} 在构建选项中 - 目标和选项:$ {SELECT_TARGET}
Then Build With parameter, it failed with 然后使用Build With参数,它失败了
[ERROR] Unknown lifecycle phase "${SELECT_TARGET}". [错误]未知生命周期阶段“$ {SELECT_TARGET}”。 You must specify a valid lifecycle phase or a goal in the format
您必须以格式指定有效的生命周期阶段或目标
In https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build . 在https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build中 。
Open issues
开放式问题
How can i pass the configured parameter to the maven execution of the build?
如何将配置的参数传递给构建的maven执行? Eg I've got a maven build and a specific profile should be given as a String parameter in the Jenkins build.
例如,我有一个maven构建,并且应该在Jenkins构建中将一个特定的配置文件作为String参数给出。
How can I make it work? 我怎样才能使它工作?
Update : 更新:
I played with Jenkins plugins and settings, I think Jenkins has a miss-configuration. 我玩Jenkins插件和设置,我认为Jenkins有一个错过配置。
How I made it work: 我是如何工作的:
And it worked. 它奏效了。 Thanks for the help.
谢谢您的帮助。
To achieve this you can simply 要做到这一点,你可以简单
SELECT_TARGET
with the values you want to choose from (the first one being the default) SELECT_TARGET
,其中包含您要选择的值(第一个是默认值) install
install -DskipTests=true
clean install
$SELECT_TARGET
(or which ever name you have chosen) in your build goals. $SELECT_TARGET
(或您选择的名称) 。 There is no need for any plugins. 不需要任何插件。 Note that this works for every thing you want to configure - that's the target of parameterized builds
请注意,这适用于您要配置的所有内容 - 这是参数化构建的目标
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.