go to index

程序员日记20250808

read time 1 min read
Jenkins UTS 流水线 数组

Jenkins

Jenkins流水线里启动后台进程被清理

默认在流水线里启动后台进程会在Jenkins进行清理的时候被杀死,例如

plaintext
nohup java -jar app.jar > nohup.out &

参考官网的wiki,需要设置环境变量来达到效果

plaintext
JENKINS_NODE_COOKIE=dontKillMe nohup java -jar app.jar > nohup.out &

UTS

原生数组类型的写法

例如原生里是这么写

java
    void onServiceAreaUpdate(AMapServiceAreaInfo[] var1);

在UTS里不能这么写

typescript
  void onServiceAreaUpdate(var1:AMapServiceAreaInfo[]);

否则编译成kotlin之后就会变成

kotlin
fun onServiceAreaUpdate(serviceAreaInfos: UTSArray<AMapServiceAreaInfo>)

正确的写法

plaintext
onServiceAreaUpdate(serviceAreaInfos: kotlin.Array<AMapServiceAreaInfo>)