How to override Maven home directory on Jenkins slave
<p>Trying to override Jenkins master maven configuration on on-demand Jenkins slave created using <a href="https://wiki.jenkins-ci.org/display/JENKINS/Amazon+EC2+Plugin" rel="nofollow noreferrer">ec2 plugin</a>. As We are using different maven versions of Maven, So I need to override the global configuration with Slave node configuration. </p>

<p><strong>Maven configuration on master:</strong></p>

<p><a href="https://i.stack.imgur.com/g8hmF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g8hmF.jpg" alt="enter image description here"></a></p>

<p><strong>Requirement:</strong>
I need to set Maven home to <code>/opt/apache-maven-3.2.5</code> on Slave. </p>

<p>Tool was already installed as it was just an AWS AMI. When ever I run the job it's checking Maven in <code>/home/csbuild/build/apache-maven-3.0.5</code>, But I want to use Maven in <code>/opt/apache-maven-3.2.5</code>. How can I update the MAVEN_HOME in the job?</p>

<p><strong>Job configuration:</strong>
<a href="https://i.stack.imgur.com/G7Ntz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/G7Ntz.jpg" alt="job configuration"></a></p>

<p>Jenskins version:1.656</p>