我正在尝试将 Jenkins-workflow 与工件集成。由于到目前为止https://github.com/jenkinsci/artifactory-plugin不支持 jenkins-workflow,所以我认为我应该使用带有 sh的https://github.com/JFrogDev/project-examples之类的 shell 脚本命令或我自己的 groovy 脚本。
我想在 cps-global-lib 中共享这个人工发布者库。因此,我无法将 JFrogDev shell 脚本存储在 global-lib 中,因为我无法从我的项目 flow.groovy 文件中调用它。到目前为止我发现的唯一解决方案是编写一个导入的全局实用程序函数
import groovyx.net.http.RESTClient;
不幸的是,片段生成器报告:
unable to resolve class groovyx.net.http.RESTClient
@ line 1, column 1.
import groovyx.net.http.RESTClient;
^
1 error
我该如何处理这种 jenkins-workflow/artifactory 集成?有没有办法在 jenkins-workflow 全局库中启用 RESTClient ?
[编辑]
根据 Jesse 的回答,我最终使用writeFile
工作流命令在工作区中编写了一个 shell 脚本。shell 脚本使用curl
.