Interview Prep/Jenkins/Shared libraries

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.

All Jenkins questions Roadmap: Jenkins

More on Shared libraries