title: mvn command not found on a jenkins pipeline
body: <p>I am really new with Jenkins and maven projects and starting to drive me crazy even with a simple sample project using <a href="https://github.com/jglick/simple-maven-project-with-tests.git" rel="nofollow noreferrer">https://github.com/jglick/simple-maven-project-with-tests.git</a></p>
  
  <p>Also using the Pipeline sample script GitHub + Maven from Jenkins</p>
  
  <pre><code>stages {
        stage('Build') {
           steps {
              // Get some code from a GitHub repository
              git 'https://github.com/jglick/simple-maven-project-with-tests.git'
  
              // Run Maven on a Unix agent.
              sh "mvn -Dmaven.test.failure.ignore=true clean package"
  </code></pre>
  
  <p>But i'm getting the next error:</p>
  
  <pre><code>+ mvn -version
  /var/lib/jenkins/workspace/app-maven@tmp/durable-dba02bb4/script.sh: line 1: mvn: command not found
  </code></pre>
  
  <p>I found an article which says to use this method for save the mvn path on a variable and use it:</p>
  
  <pre><code>steps {
      // Get some code from a GitHub repository
      git 'https://github.com/alvarosjf/maven-app.git'
  
      // Run Maven on a Unix agent.
      def mvnHome = tool name: '3.6.3', type: 'maven'
      sh "${mvnHome}/bin/mvn -version"
      //sh 'mvn -version'
  </code></pre>
  
  <p>But this is even worst showing an error at the startup</p>
  
  <pre><code>org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  WorkflowScript: 5: Not a valid stage section definition: "def mvnHome = tool name: '3.6.3', type: 'maven'". Some extra configuration is required. @ line 5, column 7.
           stage('Build') {
           ^
  
  1 error
  </code></pre>
  
  <p>Any trick to try and use a simple jenkins pipeline with Github webhooks + maven?</p>