1
在我的Jenkins构建中,我有一个Groovy脚本(因为我使用的是管道插件),我试图使用OkHttpClient
进行API调用。导入库到Jenkins groovy脚本
我有以下的葡萄代码,我从here有:
@Grapes(
@Grab(group='com.squareup.okhttp', module='okhttp', version='2.7.5')
)
对于这一点,我得到:
General error during conversion: Error grabbing Grapes -- [unresolved dependency: com.squareup.okkhttp#okhttp;2.7.5: not found]
java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: com.squareup.okhttp#okhttp;2.7.5: not found]
at sun.reflect.NativeContructorAccessorImpl.newInstance0(Native Method)
任何想法可能是错误的?
不能在Jenkins管道脚本中运行时检测包吗?
什么是詹金斯版本? –
版本是'2.46' – octavian
是否安装了[管道共享Groovy库插件](https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Shared+Groovy+Libraries+Plugin)。他们自2.3版本以来支持'@ Grab' –