How do Jenkins agents get tools like Maven, JDK or Node installed?
IntermediateConceptJenkins
Answer
Three ways: pre-bake tools into the agent image or VM (best, reproducible); use the tools { maven 'M3'; jdk 'jdk21' } directive with Global Tool Configuration auto-installers (slower, installs on demand); or run steps inside tool containers via agent { docker { image ... } } or Kubernetes pod containers. We favour containers so each repo declares its own toolchain version in the Jenkinsfile.
More on Jenkins
What is Jenkins and how is its architecture organised?BeginnerWhat are executors, nodes and labels in Jenkins?IntermediateWhy should you not run builds on the Jenkins controller?BeginnerHow do inbound (JNLP/WebSocket) and SSH agents connect to the controller?IntermediateWhat is a Jenkinsfile and where does it live?BeginnerDeclarative versus Scripted Pipeline: what are the differences?Intermediate