red888 red888 - 3 years ago 279
Groovy Question

How can i use java libraries in a jenkins pipeline?

Is it possible to import and use regular java libraries in a jenkins pipeline Shared Library? I want to import the AWS SDK for java and using it directly in the pipeline code. Do I have to add it to the src dir of my Shared Library?

Answer Source

You can use Groovy Grapes:

@Grab('com.amazonaws:aws-java-sdk:1.11.205')
import ...
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download