Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4321138
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:42:37+00:00 2026-05-21T08:42:37+00:00

I have a Maven project that is packaged as jar . And I also

  • 0

I have a Maven project that is packaged as jar.

And I also have a Maven project that is packaged as war. This war project has a tld file and some xhtml files (the tag libs). The structure of the war project is (basically):

pom.xml
src
    main
       java
           ...
       webapp
           WEB-INF
               my-facelets.taglib.xml
               facelets
                   aTag.xhtml
                   anotherTag.xhtml
           META-INF
               my-facelets.taglib.tld

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:

<resources>
  <resource>
    <directory>src/main/tld</directory>
    <targetPath>META-INF</targetPath>
  </resource>

  <resource>
    <directory>src/main/taglib</directory>
    <targetPath>WEB-INF</targetPath>
  </resource>
</resources> 

And put the files, of course, into src/main/tld (the ones I wanted to export into META-INF) and src/main/taglib (the ones I wanted to export into WEB-INF). And the jar was created as I wish:

myjar
    com
        my
            classes
    WEB-INF

    META-INF
        my-facelets.taglib.tld
    WEB-INF
        ...

And then I added this new jar to my first war project, as a maven dependency.

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 WEB-INF/lib) 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T08:42:38+00:00Added an answer on May 21, 2026 at 8:42 am

    The practice these days is to put the TLD files into the tag library JAR and let the class loader find them. Download the Apache JSTL JARs and see how they do it. I’d recommend following that convention. It’ll simplify your app too, because you won’t have to declare the TLD in your web.xml file: just put the JAR in your CLASSPATH and make sure that the URI in your .jsp matches that in the TLD.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a maven project that has both code and documentation (pdf files). When
I have a Maven project that is a child project. It has many sibling
I have a maven project with a dependency (datanucleus-db4o). This dependency has itself a
I have a small command line utility project that I'm using Maven to manage.
I have a Maven project that consists of several modules. I have a single
I have a maven project A that use hibernate-annotations 3.4.0.GA which use the slf4j-api
I have a new web app that is packaged as a WAR as part
I have a series of Servlets and Servlet Filters in a maven project that
I'm building an executable jar for a maven java project I have. It works
I have maven project that consists of several modules. I want to add an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.