title: How to install maven on microsoft Azure (app servies)
body: <p>I have an app service, hosted on Azure. </p>
  
  <p>The code for our service is on bitbucket and it is a maven based Java project. The process adopted by developers to deploy WAR files is to build them on local and FTP it to Azure which obviously isn't recommended. </p>
  
  <p>Let's say I don't have the liberty and resource for hosting a CI tool like Jenkins, I am trying to do the following:</p>
  
  <ol>
  <li><p>Sync the code from bitbucket.org to Azure by using 'Deployment Options' in Azure. Every time I do a git push, Azure automatically picks up the code from the specified branch and copies/updates/deletes the files modified (and places them under wwwroot by default)</p></li>
  <li><p>I want to modify the deployment.cmd file in Azure so that I can add my custom steps post #1. </p></li>
  </ol>
  
  <p>Where am I stuck? </p>
  
  <ol>
  <li>I have FTPed maven and unpacked maven under <code>D:\home\maven</code> folder. I have set the correct environment variables by using a XDT file (attached). Yet, when I do mvn -version, I get the following error:</li>
  </ol>
  
  <blockquote>
    <p>java.lang.NoClassDefFoundError:
    org/apache/maven/exception/ExceptionHandler</p>
    
    <p>..
    ..
    caused by ClassNotFound .. </p>
  </blockquote>
  
  <p>I don't have the complete trace handy. This class is there in maven-core which is there under the lib folder (I verified).</p>
  
  <p>Could it be because of permissions? Cloud is cloudy to me o_O</p>
  
  <ol start="2">
  <li>After I get this to work, I need to add custom steps to deployment.cmd. Is there any specific language which I need to use or windows commands? </li>
  </ol>
  
  <p>XDT file content for env variables (<code>JAVA_HOME</code> is already set)</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt; 
  &lt;configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-   Transform"&gt; 
  &lt;system.webServer&gt; 
  &lt;runtime xdt:Transform="InsertIfMissing"&gt;
  &lt;environmentVariables xdt:Transform="InsertIfMissing"&gt;      
  &lt;add name="M2_HOME" value="D:\home\maven\apache-maven-3.3.9"  xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" /&gt;
  &lt;add name="MAVEN_HOME" value="D:\home\maven\apache-maven-3.3.9" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" /&gt;
  &lt;add name="Path" value="%Path%%JAVA_HOME%\bin;%M2_HOME%\bin;" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" /&gt;    
  &lt;/environmentVariables&gt;
  &lt;/runtime&gt; 
  &lt;/system.webServer&gt; 
  </code></pre>
  
  <p></p>