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

  • SEARCH
  • Home
  • 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 9231607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:06:47+00:00 2026-06-18T06:06:47+00:00

I have a problem with ear files to get the same libraries in several

  • 0

I have a problem with ear files to get the same libraries in several places and therefor creating conflicts. The problem is that we use a lot of 3:rd party libs that we simply doesn’t control. So, we end up with throwing in a lot of excludes everywhere and that doesn’t seem right to me, it is kind of error-prone and we don’t detect the problem on our local installations of jboss either.

So, I’d like to perform some kind of pre-package-step that simply removes the duplicate jar-files. If deployed in two places, remove those that are in dependant projects. For instance jboss-seam.jar is included in several projects we use. Some of these dependencies are general and included in the parent.pom. Some of the dependences are ejb-specific or web-specific and is therefore included in the ejb and/or web-project. In the ear-file the jboss-seam.jar is included in three places and messes upp the classloader. So there should be some mechanism that simply checks some simple rule like, if in ear, should not be in war instead of having to create xml-hell with excludes.

Is there a better way to handle the problem?

  • 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-06-18T06:06:48+00:00Added an answer on June 18, 2026 at 6:06 am

    Sounds like you are using maven to build your artifacts? If so, the best recourse is the <exclusions> tag.

    Using mvn dependency:tree with liberal application of grep it’s quick to find which 3rd party artifacts that contribute conflicting versions of transitive dependencies.

    I understand your sentiment about it not seeming right, and in a perfect world everyone should be better to write POMs for their published artifacts, but this is an imperfect world… I’m actually not even sure it could ever work perfectly for all situations, perhaps someone with better knowledge of maven can elaborate on that.

    In the case of the same artifact being present in eg. both ear/lib/ and ear/webapp/WEB-INF/lib you could use <scope>provided</scope> in the the webapp’s POM:

    <dependency>
        <artifactId>spring-core</artifactId>
        ...
        <scope>provided</scope>
    </dependency>
    

    At least on Weblogic this works by default if you put the jar in the <earfile>/APP-INF/lib folder, and for other EE containers I believe you can achieve the same adding

    <application>
        <library-directory>APP-INF/lib</library-directory>
    </application>
    

    to the application.xml descriptor.

    I hope that helps.

    Cheers,

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

Sidebar

Related Questions

I have problem SIMILAR to preventing form data reposting, but not quite the same
I have problem developing with live555. I already build the lib-files and example projects
Our application have several EARs deployed to a single JBOSS-AS. Every EAR uses SLF4J
I have built an ear with this structure (not all files shown here): myapp.ear/
I have a web application that is deployed on WebSphere and that use one
I have a maven build that creates an ear wich is deployed to Glassfish
I have the following problem. When I deploy my ear file to server\default\deploy folder
I have a project where 3 war-modules are packaged in an ear-module. My problem
I have an ear file that consists of a war file together with a
I have a signed jar bundled in an ear that searches for a configuration

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.