简体   繁体   English

远程触发构建时如何传递system.getproperty值

[英]How to pass the system.getproperty values when triggering the build remotely

Currently i am using the below option (refer the below screenshot) to send the username and password to pass these to the java program (i will access the username and password using System.getProperty("user"). But when triggering jenkins job remotely i don't know how to pass these (username and password) as these values gets changed every now and then. So my question is how do i pass these when using the remote url ( http://localhost:8080/job/Test/build?token=xyz ) 目前,我正在使用以下选项(请参阅下面的屏幕截图)发送用户名和密码,以将它们传递给Java程序(我将使用System.getProperty(“ user”)访问用户名和密码。但是当远程触发jenkins作业时我不知道如何传递这些值(用户名和密码),因为这些值会不时更改。所以我的问题是使用远程URL时如何传递这些值( http:// localhost:8080 / job / Test / build?token = xyz

詹金斯(Jenkins)屏幕截图

It looks like you're using Maven, and this issue here is likely the fact that Maven requires the options to be set before the goals. 看来您正在使用Maven,这里的问题很可能是Maven需要在目标之前设置选项的事实。 So you'd need to use: 因此,您需要使用:

-Duser=username -Dpass=password clean install

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

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