title: How to exclude unwanted JARs from exported WAR
body: <p>I'm using maven to build my Spring Dynamic Web Project. I got recommendations from my security team to remove certain JARs citing some sort of vulnerabilities. I have manually removed those JARs from by WEB-INF/lib/ everything is working for me.</p>
  
  <p>But I would like to automatically remove those JARS at the time of exporting WAR file.</p>
  
  <p>I've tried below </p>
  
  <pre><code>    &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.2.2&lt;/version&gt;
          &lt;configuration&gt;
          &lt;warSourceExcludes&gt;WEB-INF/lib/jstl-1.2.jar&lt;/warSourceExcludes&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
   &lt;/plugins&gt;
  </code></pre>
  
  <p></p>
  
  <p>I tried <code>packagingExcludes</code> in the place of <code>warSourceExcludes</code> but no luck. And I tried the different version of maven-war-plugin.</p>