title: Maven and Jenkins - 'mvn' is not recognized as an internal or external command,
body: <p>I am trying to learn Jenkins and Maven.</p>
  
  <p>So Far what i have done:</p>
  
  <ol>
  <li>Installed Maven and set <code>M2</code> and <code>M2_HOME</code> as env variables  </li>
  <li>Created a simple maven project from eclipse. --> Created a <code>.bat</code> file in which I am moving to the directory where the <code>pom.xml</code> file is located and running  <code>mvn clean package</code>. I run this bat file.   </li>
  </ol>
  
  <p>Everything went as expected till here.</p>
  
  <ol start="3">
  <li>Now I installed jenkins and created a item (or job) > Added build step as "Execute Windows batch command" . and entered the bat location.</li>
  </ol>
  
  <p>But I am getting the following error:</p>
  
  <pre><code>*Started by user anonymous*
  *Building in workspace C:\Users\abhi\ .jenkins\jobs\Maven\workspace*
  *[workspace] $ cmd /c call C:\WINDOWS\TEMP\hudson6018913903543004539.bat*
  
  *C:\Users\abhi\ .jenkins\jobs\Maven\workspace&gt;C:\Users\abhi\Desktop\ma.bat*
  
  *C:\Users\abhi\ .jenkins\jobs\Maven\workspace&gt;E:*
  
  *E:\&gt;cd AllStuffLearning\EclipseWorkSpaces\MavenWorkSpace\MyMavenPrj\ *
  
  *E:\AllStuffLearning\EclipseWorkSpaces\MavenWorkSpace\MyMavenPrj&gt;chdir*
  *E:\AllStuffLearning\EclipseWorkSpaces\MavenWorkSpace\MyMavenPrj*
  
  *E:\AllStuffLearning\EclipseWorkSpaces\MavenWorkSpace\MyMavenPrj&gt;mvn clean* *package *
  *'mvn' is not recognized as an internal or external command,*
  *operable program or batch file.*
  *Build step 'Execute Windows batch command' marked build as failure*
  *Finished: FAILURE*
  </code></pre>