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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:51:42+00:00 2026-06-18T17:51:42+00:00

We have a multi-module POM, which also serves as a parent POM for all

  • 0

We have a multi-module POM, which also serves as a parent POM for all sub-modules involved. Call it MultiModulePOM. We have about 70 modules, say numbered Module1 to Module70.

Now: The first 30 of these modules require a set of JAR files at compile-time only. That is – scope=provided. Since we’re talking about a set of JAR files, it is quite tedious to keep those 30 modules in sync and in general, I am not a huge fan of copying definitions around.

So, I fell into the pitfall of dependency grouping. Seemed like a good idea, however it doesn’t work for provided dependencies. In other words: if I group the dependent JARs in a module called ExtDependencies, and make Module1 depend on ExtDependencies, the JARs referred-to by ExtDependencies won’t be transitively-added to Module1, because their scope is provided.

(If the last paragraph is not true, please let me know as it could really get me out of a jam)

The only other option that I could see was to create a parent POM called (for example) IntermediaryPOM. IntermediaryPOM extends MultiModulePOM and enlists the set of dependent JAR files with scope=provided. Modules Module1–Module30 then extend IntermediaryPOM.

That seemed to do the trick but I have three problems with it:

  1. It adds another layer of POM that I’m not sure is really needed.
  2. Later, during distribution time, I find myself having to install/deploy the intermediary POM’s as well.
  3. Consider the general case: the intermediary POM may have other siblings used for other sets of JARs (for modules 31-50). Therefore, this solution doesn’t seem to scale well.

So my question is – according to your experience, what is the best way to approach this? any known best practices for such a use case?

  • 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-18T17:51:43+00:00Added an answer on June 18, 2026 at 5:51 pm

    I’m afraid there is no easy solution here.

    You’re right saying that if you declare common dependencies in ExtDependencies as provided they won’t be added to the classpath of any other module that is dependent on ExtDependencies. That’s how provided works.

    But you could declare these common dependencies without scope (e.g. with default compile scope) and add provided dependency on ExtDependencies. In this case all of the ExtDependencies dependencies will be added to classpath. God, that’s a lot of “dependencies” 🙂

    You’ve also mentioned other possible option — introduce another level of abstraction (which, as you might know, is a way to solve almost any problem). But such multi-level hierarchy is less elegant and more difficult to maintain (I have it in our projects, so I’ve been there).

    In general, I haven’t come across this problem in such a scale but if I were to solve it I’d go with the first option taking into account scoping suggestion.

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

Sidebar

Related Questions

I have a multi-module maven project made up of three sub-modules: web , service
I have the multi module project this is the parent pom. <?xml version=1.0 encoding=UTF-8?>
I have a multi-module maven project. We intend to version all these modules together.
I have a multi-module project. parent POM (1.0-SNAPSHOT) |-- module1 (1.0-SNAPSHOT) |-- module2 (1.0-SNAPSHOT)
I have a maven multi-module pom which builds a war. I want to declare
I have a multi-module project, and I am using profiles in the parent pom
I have a relativey simple multi module maven buid with a parent pom. This
I have a multi-module project and in the parent pom, I have several reporting
I have Maven multi-module project with such structure: parent-pom-project -- module1 -- module2 At
I have some multi-module project. Some modules are packaged as wars and some as

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.