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 7645303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:54:26+00:00 2026-05-31T09:54:26+00:00

I have the following project: 5(+) jars, each building specific components, with both common

  • 0

I have the following project:
5(+) jars, each building specific components, with both common dependencies and jar-specific dependencies
1 war (which bundles these jars, and their dependencies)
1 ear (which holds the war and only the war)

How do I fit all of this nicely into maven?

I had the following setup:

    project-root.pom
     |- generic jar dependency 1
     |- generic jar dependency 2
     |- modules
         | - jar 1 (uses generic dependencies, and a couple of others)
         | - jar 2 (uses generic dependencies, and a couple of others)
         | - war project (uses generic jars, and jar 1 and 2)
         | - ear project

But this doesn’t work, as the ear project will include the generic jar dependencies of the parent in the /lib folder.

How can such a project be set up nicely in maven?


Update

I kinda worked around it by having a root pom which declares modules for jar1, 2, the war and the ear project, but only having jar1, jar2, and the war inherit from the parent pom. The ear project doesn’t. Is this proper practice?

  • 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-31T09:54:28+00:00Added an answer on May 31, 2026 at 9:54 am

    The structure you scribbled down gives me a different feeling about your project structure. Let me describe that a little bit. If i see a structure like the following i would assume:

    project-root.pom
      |- generic jar dependency 1 (parent: project-root.pom)
      |- generic jar dependency 2 (parent: project-root.pom)
      |- modules
          +-- module-pom
          | - jar 1 (uses generic dependencies, and a couple of others) (parent:module-pom)
          | - jar 2 (uses generic dependencies, and a couple of others)(parent:module-pom)
          | - war project (uses generic jars, and jar 1 and 2) (parent:module-pom)
          | - ear project (parent:module-pom)
    

    But you described in the text the relationship of the module in a differnt way:

    root
     |- generic jar dependency 1
     |- generic jar dependency 2
     |- jar 1 (uses generic dependencies, and a couple of others)
     |- jar 2 (uses generic dependencies, and a couple of others)
     |- ear project
     |- war project (uses generic jars, and jar 1 and 2)
    

    With the above structure you can simply define the dependencies in the war like depending on jar-1, jar-2. The ear depends on the war only. The jar-1 might depend on the generic-jar depency 1 and so on. The levels give the observer a different impression of the project as it really has. So you structure should represent you dependency structure. I’m not sure if this the correct structure for your project but represent the structure (folder structure) as your dependencies direct you.

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

Sidebar

Related Questions

In my project I have the following three interfaces, which are implemented by classes
I have project which includes external jar file in it, I followed this link
I have a Android project which I'm building in Ant and I'm stuck on
I have a case that I have the following cyclic dependencies in maven: JAR
I am having problem building my project (using maven 2) which references some jars
I have a project built in eclipse with a dependencies on 3rd party jars.
I have a legacy war project that depends on a jar project, the jar
MSBuild 3.5 I have the following project structure: trunk/MainSolution.sln trunk/Build/MyBuild.Proj trunk/Library/... trunk/etc... So far,
I have created the following project structure for my new asp.net mvc project any
I have the following situation Project A - Uses Castle Windsor v2.2 - Uses

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.