title: Deploying war to tomcat using chef
body: <p>I'm attempting to automate deploying a war to tomcat using the chef system. </p>
  
  <p>I've have a war which previously I would either upload using the manager servlet or just copy to /var/lib/tomcat6/webapps/, but that doesn't appear to be the chef way.</p>
  
  <p>I've got the following in my recipe:</p>
  
  <pre><code>application "app" do
      path "/usr/local/app"
      repository "/root/dist/app-0.1.war"
      scm_provider Chef::Provider::File::Deploy
      tomcat
  end
  </code></pre>
  
  <p>Which runs but doesn't work -- Catalina.out is giving</p>
  
  <pre>
  May 5, 2013 2:32:31 AM org.apache.catalina.startup.HostConfig deployDescriptor
  SEVERE: Error deploying configuration descriptor app.xml
  java.io.FileNotFoundException: /etc/tomcat6/Catalina/localhost/app.xml (No such file or directory)
  </pre>
  
  <p>Edit: Right now I've got a workaround in place which manually places the war into the webapps directory, blows away the prior exploded directory and restarts tomcat.  It seems, though, that I'm working too hard and inelegantly for what ought to be simple.</p>
  
  <p>What's the best way to do this?</p>