What is a shared library in Jenkins and why use it?
⚡
Quick Answer
A versioned Groovy library of reusable pipeline steps shared across many Jenkinsfiles.
Detailed Answer
Shared libraries (loaded via @Library) let you define custom steps and templates once and reuse them across teams, keeping Jenkinsfiles thin and consistent. They're versioned in their own repo, so pipeline logic is reviewed and tested like any code.
💡
Interview Tip
Frame it as DRY pipeline code across repos.
jenkinsshared-librarydry