fetching parameters from a jenkins job in java code

前端 未结 3 898
广开言路
广开言路 2021-01-22 05:44

I have a parameterised jenkins job that is accessing my plugin. Inside plugin\'s code in java, i require these parameters using which i have to trigger another job in jenkins. I

3条回答
  •  滥情空心
    2021-01-22 05:54

    To the best of my knowledge, Jenkins parameters are exposed as environment variables. However, if you use a build system like Maven that launches Java sub-processes, those variables might not be inherited.

    Probably your most reliable approach is to explicitly pass parameters as system properties in your Jenkins configuration, eg -DREPOS=${REPOS}

提交回复
热议问题