bsky
bsky

Reputation: 20222

Using @Grab in Jenkins pipeline plugin

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

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]

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

Upvotes: 0

Views: 3861

Answers (1)

dynamo
dynamo

Reputation: 1153

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')

Upvotes: 2

Related Questions