title: Maven Release using Jenkins Pipeline
body: <p>I'm currently trying to use Jenkins Pipeline to deploy the project I'm working on.</p>
  
  <p>The problem appears when I use the following commands:</p>
  
  <pre><code>stage("Prepare") {
       sh "mvn -B -s $MAVEN_SETTINGS release:prepare -DreleaseVersion=$releaseVersion -DdevelopmentVersion=$developmentVersion"
  }
  </code></pre>
  
  <p>I receive this error:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release- plugin:2.5:prepare (default-cli) on project *my_project*: Unable to commit files
  [ERROR] Provider message:
  [ERROR] The git-add command failed.
  [ERROR] Command output:
  [ERROR] /bin/sh: git: not found
  </code></pre>
  
  <p>As you can see, the error is caused by the git add command, which can't be performed.
  I have to mention that in a previous stage, in the script, I successfully clone the project, by using a <code>git url:</code> command. 
  However, if I try a simple git command, like <code>sh "git --version"</code>, I get <code>git: not found</code>. </p>
  
  <p>So, my question:</p>
  
  <p>In order to be able to use mvn command, I used the next command:</p>
  
  <pre><code>env.PATH = "${tool 'maven 3.0.5'}/bin:${env.PATH}"
  </code></pre>
  
  <p>Is it possible to do the same, or any other solution, for git, such that the <code>mvn release:prepare</code> will be able to run git add?</p>
  
  <p>Thank you.</p>