title: How to include all jars in a directory to an ear using maven?
body: <p>My EAR project structure is like this:</p>
  
  <pre><code>+- MyEar
  |  +- Earcontent
  |     +- lib
  +-
  +-
  +- pom.xml 
  </code></pre>
  
  <p>I want to get all the jars in Earcontent/lib folder in my built MyEar.ear.
  I gave defaultLibBundleDir as 'lib' in my pom.xml. So I want to get all the jars in Earcontent/lib in MyEar.ear/lib folder.</p>
  
  <pre><code> &lt;defaultLibBundleDir&gt;lib/&lt;/defaultLibBundleDir&gt;
  </code></pre>
  
  <p>My pom.xml looks like :</p>
  
  <pre><code>&lt;build&gt;
  &lt;plugins&gt;
    &lt;plugin&gt;
      &lt;artifactId&gt;maven-ear-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.10.1&lt;/version&gt;
      &lt;configuration&gt;
        &lt;defaultLibBundleDir&gt;lib/&lt;/defaultLibBundleDir&gt; 
      &lt;/configuration&gt;
    &lt;/plugin&gt;
  &lt;/plugins&gt;
  </code></pre>
  
  <p></p>
  
  <p>UPDATE: I tried </p>
  
  <p><code>&lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-ear-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.10.1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;defaultLibBundleDir&gt;lib/&lt;/defaultLibBundleDir&gt; 
            &lt;packagingIncludes&gt;${basedir}\EarContent\lib\*.jar&lt;/packagingIncludes&gt; 
          &lt;/configuration&gt;
        &lt;/plugin&gt;</code></p>
  
  <p>But now when I build ear, The lib folder inside the ear as a whole is missing.</p>
  
  <p>I tried same scenario in gradle build.gradle. There we are using fileTree. </p>
  
  <pre><code>compile fileTree(dir: "../MyEar/EarContent/lib", includes: ['*.jar']);
  </code></pre>
  
  <p>Since I am using maven, I want an equivalent for this in maven</p>