title: Can I use ant war task to export a war built with Maven?
body: <p>Im using eclipse and maven for my day to day development, which works fine. However I need a specialized war created when its time to export to send over to production, which includes things like minifying and combining js/css etc, separating out static resources for apache rather than tomcat etc.</p>
  
  <p>I tried the maven plugin route but it was a hassle, I'd rather write a simply ant script to export when necessary. I'm using the ant war task, but the exported war contains everything except my WEB-INF/libs folder, which is blank. Does anyone know a way to make the script work with all the libs that maven looks up? This is what I have:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project name="MyProject" default="war" basedir="."&gt;
  
      &lt;property name="builder" value="Me" /&gt;
      &lt;property name="project-name" value="${ant.project.name}" /&gt;
      &lt;property name="war-file-name" value="${project-name}.war" /&gt;
      &lt;property name="source-directory" value="src/main/java" /&gt;
      &lt;property name="classes-directory" value="target/classes" /&gt;
      &lt;property name="web-directory" value="src/main/webapp" /&gt;
      &lt;property name="web-xml-file" value="src/main/webapp/WEB-INF/web.xml" /&gt;
      &lt;property name="build-directory" value="/" /&gt;
  
      &lt;tstamp prefix="build-info"&gt;
          &lt;format property="current-date" pattern="d-MMMM-yyyy" locale="en" /&gt;
          &lt;format property="current-time" pattern="hh:mm:ss a z" locale="en" /&gt;
      &lt;/tstamp&gt;
  
      &lt;target name="war" depends=""&gt;
          &lt;mkdir dir="${build-directory}" /&gt;
          &lt;delete file="${build-directory}/${war-file-name}" /&gt;
          &lt;war warfile="${build-directory}/${war-file-name}" webxml="${web-xml-file}"&gt;
              &lt;classes dir="${classes-directory}" /&gt;
              &lt;fileset dir="${web-directory}"&gt;
                  &lt;exclude name="WEB-INF/web.xml" /&gt;
              &lt;/fileset&gt;
              &lt;manifest&gt;
                  &lt;attribute name="Built-By" value="${builder}" /&gt;
                  &lt;attribute name="Built-On" value="${build-info.current-date}" /&gt;
                  &lt;attribute name="Built-At" value="${build-info.current-time}" /&gt;
              &lt;/manifest&gt;
          &lt;/war&gt;
      &lt;/target&gt;
  
  &lt;/project&gt;
  </code></pre>