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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:36:41+00:00 2026-05-16T20:36:41+00:00

My project is made of 5 sub projects. One is a War, and the

  • 0

My project is made of 5 sub projects. One is a War, and the other 4 are jars. Basically the war project needs all 4 jar projects, and their dependencies.

I can strip down the dependencies to have something like war->A->B->C->D. Every sub project add their share of external dependencies (spring, struts, hibernate) so that in the end the war gets everything needed to run.

This looks pretty well organised and square, but then I ask myself if this is very practical to make changes.

Imagine I have to change one line of code in project D, without changing anything to its Maven dependencies. I would have to re-release project D obviously, but then I have to re-release projects C, B, A, and the war just to reflect this change in their pom files. This can be long and annoying, especially if you have to quickly release a new version to fix something in production.

I could make the war depend on all 4 projects, so then I just have to change project D version number in the war pom file. But then I have project A depending indirectly on project D 1.0 and the war specifying project D 1.1. I think that the war direct dependency would win in that case wouldn’t it ?

This would make the new war release quicker, but it would also mess my sub projects dependencies, as they would be outdated.

What would be an acceptable way to handle this situation ?

  • 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-16T20:36:41+00:00Added an answer on May 16, 2026 at 8:36 pm

    There is no simple answer to your problem.

    If you indeed do have a chain of transitive dependencies (A->B->C->D), then releasing each modules up the chain independently is not a bad option. Although it is tedious, there is a good chance your nested dependencies are simple lib jars and will not see changes too often. Hopefully you will not be forced to go through that process frequently. Pretend it would be the same situation as if log4j was updated and all of your modules needed to be updated as well.

    Another thing to consider is your WAR’s dependencies. Yes, Maven will pull dependencies in automatically for you but it is often a good practice to declare your known dependencies explicitly so you can specify a version number yourself for each module. This would mean A depends on D and the others directly. Unfortunately, if you have conflicting version numbers, as you’ve described, then you are looking for trouble on your classpath. If you really need to do this though, maven does allow you exclude transitive dependencies explicitly:

    <project>
      ...
      <dependencies>
        <dependency>
          <groupId>my.project</groupId>
          <artifactId>module-B</artifactId>
          <version>1.0</version>
          <exclusions>
            <exclusion>
              <groupId>my.project</groupId>
              <artifactId>module-C</artifactId>
            </exclusion>
            <exclusion>
              <groupId>my.project</groupId>
              <artifactId>module-D</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>my.project</groupId>
          <artifactId>module-C</artifactId>
          <version>1.0</version>
          <exclusions>
            <exclusion>
              <groupId>my.project</groupId>
              <artifactId>module-D</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>my.project</groupId>
          <artifactId>module-D</artifactId>
          <version>1.0</version>
        </dependency>
      </dependencies>
      ...
    </project>
    

    Here is the documentation describing these optional dependencies and exclusions.

    Do you actually need to release B, C, and D independently? If not, consider using an Aggregator pom.xml file at the root of your modules. This will allow you to use SNAPSHOT versions throughout your modules and then release the bunch at once. This is the way our team manages our multi-module project. Using SNAPSHOT dependencies ensures you use the version that was JUST built when those artifacts are needed.

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

Sidebar

Related Questions

I added google-collect-1.0.jar to my Android project and it made a 50K .apk into
I have a multi-module maven project made up of three sub-modules: web , service
I am trying to show a path of related project activities. Basically you can
I've made vb console application project in vs 2010 and added one class with
in Xcode 4, I created a sub project in my iOS project and made
So I have this Java project made up of several classes, some external JAR
I have a project made with PhoneGap 1.1. I don't want to upgrade to
I'm trying to use sbt to compile an Android Project made in Java, which
I'm using SAS Enterprise Guide 5.1 and I have a project made of 4
I learning Perl and doing a home made project to my family (a subscription

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.