title: IntelliJ IDEA - Run/debug doesn't copy resources
body: <p>I have a maven project which is packaged as WAR. The POM looks something like the following:</p>
  
  
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;artifactId&gt;my_app&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;build&gt;
          &lt;finalName&gt;${project.artifactId}&lt;/finalName&gt;
          &lt;plugins&gt;
             &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-pmd-plugin&lt;/artifactId&gt;
                ...
              &lt;/plugin&gt;
              ...
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>When I manually run the command <code>mvn package</code>, a WAR is generated with directory <code>target/my_app</code> where my web resources (JSP, CSS, JS, images, etc.) are copied to. The generated WAR, if uploaded to an Application Server, works fine.</p>
  
  <p>However, if I use IntelliJ IDEA's Run/Debug configuration (which is configured to deploy the WAR to an Application Server (JBoss if that matters)) to do the same, I don't see the web resources. Only configuration XMLs and compiled classes is present in the <code>target/my_app</code> directory. The applicaiton server starts up all fine without any errors and  WAR is deployed successfully, however I can't accesss it as it returns 404.</p>
  
  <p>How can I acheive what I get when building and manually uploading the WAR using <em>Run/Debug</em> of IntelliJ IDEA?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Before launch tasks are:</p>
  
  <ul>
  <li>Build</li>
  <li>Build 'my_app:war exploded' artifact</li>
  </ul>