Jenkins Global tools

How does the Jenkins Global tools works under the hood.
If we configure a maven tool in Jenkins Global tools, will it download and install maven in all the agent nodes or downloads and install only on the agent where we are running the maven build command.

ex- 1 master node and 2 agent node

pipeline {
  tools {
    maven 'maven-3.6.3' 
  }
  stages {
    stage ('Build') {
        agent{ label 'agent-1' }
      steps {
        sh 'mvn clean package'
      }
    }
    
  }
}

1.Will the maven be installed on all the nodes or only on agent-2?
2. After the pipeline completes will the Jenkins uninstall the maven from the nodes?

HI @rakrakshith77,

Plugins are installed on the Jenkins controller and will run where you run your job/pipeline

No, it’s not uninstall the plugin is already installed on the controller and each time you need it it’s run

Thanks for your reply

Will that means the maven is installed on the controller?

Yes, it’s the case, you can see this link to better understand how plugin work

In the above Jenkinsfile script, i have run the maven build command on agent-2, therefore maven should be installed in agent-2 to run the build command. Will that mean the controller will install it and uninstall after the build?