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?
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?
From this answer, check the output of println System.getProperty("java.ext.dirs")
Then try and put our jar in that folder (as seen in this other answer).
This is at best a workaround though, and the "Extending with Shared Libraries" only mentions classpath as part of an official shared library directory structure:
The
srcdirectory should look like standard Java source directory structure. This directory is added to the classpath when executing Pipelines.
Example for importing a library:
import org.apache.http.client.utils.URIBuilder;
pipeline{
}