title: Specify context-path for spring-boot WAR
body: <p>I have a spring boot web application that deploys as a WAR. Right now when I deploy it to my Tomcat 7 server, it uses the name of the war file as the context, such as /myartifactid-1.5.4.SNAPSHOT/. I want to specify the context-path, but </p>
  
  <pre><code>server.contextPath=/mywebapp
  </code></pre>
  
  <p>seems to only work for embedded tomcat. I've added a META-INF/context.xml with only this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Context antiJARLocking="false" path="/mywebapp" /&gt;
  </code></pre>
  
  <p>but that hasn't had any effect. </p>
  
  <p>EDIT: This is NOT a spring-boot issue, but instead related to how NetBeans behaves differently from Eclipse. NetBeans apparently recognizes the context path parameter in context.xml, but Eclipse doesn't. In Eclipse you have to modify the Web Projects Settings to set the context path.
  <a href="https://stackoverflow.com/questions/9522054/changing-tomcat-context-path-of-web-project-in-eclipse">Changing Tomcat context path of web project in Eclipse</a></p>