在Jenkins管道插件中使用@Grab [英] Using @Grab in Jenkins pipeline plugin

查看:469
本文介绍了在Jenkins管道插件中使用@Grab的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Jenkins版本中,我正在使用管道插件

In my Jenkins build, I am using the pipeline plugin.

在其中,我正在进行REST呼叫.

Within it, I am making a REST call.

对于该呼叫,我需要使用:

For that call, I needed to use:

@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7' )

但是,为此,我得到了错误:

However, for this I am getting the error:

org.codehaus.groovy.control.MultipleCompilationErrorsExcepti‌​on: startup failed: General error during conversion: Error grabbing Grapes -- [unresolved dependency: org.codehaus.groovy.modules.http-builder#http-builder;0.7: not found]

那么如何在Jenkins管道插件中使用@Grab?

So how can I use @Grab in the Jenkins pipeline plugin?

推荐答案

发生异常是因为grapes无法找到httpclient 4.2.1,因此添加http client 4.2.6,它应该对您有用.

The exception occurs because somehow grapes isn't finding httpclient 4.2.1 so add http client 4.2.6 and it should work for you.

@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7' )

@Grab('org.apache.httpcomponents:httpclient:4.2.6')

这篇关于在Jenkins管道插件中使用@Grab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆