首页 > 解决方案 > Nexus:上传文件时连接超时

问题描述

使用 jenkins 管道脚本将 .tgz 文件上传到 nexus 时出现错误。

在此处输入图像描述

在我的管道脚本中使用舞台作为

stage('上传 tar 文件到 nexus') { steps { sh """ curl -f -v $NEXUS --upload-file partnerPortal-* http://localhost:8080/repository/partnerFrontEnd-test/partnerPortal-date +"%d-%m-%Y-%H.%M" .tgz """ } }

注意:我在同一台服务器上有 jenkins 和 nexus。我的主机文件有 127.0.0.1 localhost

标签: jenkins-pipelinenexus3

解决方案


将 -u 添加到 curl 命令后,解决了我的问题。

curl -f -v -u $NEXUS --upload-file customerPortal-* https://localhost:8081/-date +"%d-%m-%Y-%H.%M" .tar.gz


推荐阅读