What is `@Grab` and should you use it in libraries?
AdvancedConceptShared libraries
Answer
@Grab downloads Maven dependencies into the controller's classpath at runtime. It only works in trusted libraries, runs on the controller, pulls arbitrary jars from the internet and can conflict with plugin classes. Avoid it. If you need a tool (a YAML library, an HTTP client), run it in the build container with sh or use an existing plugin step such as readYaml or httpRequest.
More on Shared libraries
What is the directory structure of a shared library?BeginnerHow does a `vars/` global step work?BeginnerWhat goes in `src/` and how is it used?IntermediateHow do classes in `src/` call pipeline steps?IntermediateWhat is `libraryResource` used for?IntermediateWhat are the ways to load a library in a Jenkinsfile?Intermediate