title: How to add TLD and Tag Lib files into a Maven's jar project
body: <p>I have a Maven project that is packaged as <code>jar</code>.</p>
  
  <p>And I also have a Maven project that is packaged as <code>war</code>. This war project has a tld file and some xhtml files (the tag libs). The structure of the war project is (basically):</p>
  
  <pre><code>pom.xml
  src
      main
         java
             ...
         webapp
             WEB-INF
                 my-facelets.taglib.xml
                 facelets
                     aTag.xhtml
                     anotherTag.xhtml
             META-INF
                 my-facelets.taglib.tld
  </code></pre>
  
  <p>And then appeared a requirement to remove those xml, xhtml and tld files from the war project and package them into the jar project. So my first try was add in the jar project's POM:</p>
  
  <pre><code>&lt;resources&gt;
    &lt;resource&gt;
      &lt;directory&gt;src/main/tld&lt;/directory&gt;
      &lt;targetPath&gt;META-INF&lt;/targetPath&gt;
    &lt;/resource&gt;
  
    &lt;resource&gt;
      &lt;directory&gt;src/main/taglib&lt;/directory&gt;
      &lt;targetPath&gt;WEB-INF&lt;/targetPath&gt;
    &lt;/resource&gt;
  &lt;/resources&gt; 
  </code></pre>
  
  <p>And put the files, of course, into <code>src/main/tld</code> (the ones I wanted to export into <code>META-INF</code>) and <code>src/main/taglib</code> (the ones I wanted to export into <code>WEB-INF</code>). And the jar was created as I wish:</p>
  
  <pre><code>myjar
      com
          my
              classes
      WEB-INF
  
      META-INF
          my-facelets.taglib.tld
      WEB-INF
          ...
  </code></pre>
  
  <p>And then I added this new jar to my first war project, as a maven dependency.</p>
  
  <p>The problem is that those .tld, .xhtml, .xml files that are inside the jar's META-INF, WEB-INF (the jar is inside war's <code>WEB-INF/lib</code>) are not recognized. Apparently they should be directly into the war structure, unless some other configuration is performed. This is a must-have requirement, because multiple war projects will use the features (classes and taglibs) of the jar project.</p>