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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:23:44+00:00 2026-05-24T02:23:44+00:00

I have searched for such a question without finding anything, so here I go.

  • 0

I have searched for such a question without finding anything, so here I go.

I have a multi-module maven project. Multiple modules all inherit the same parent, where common dependencies are defined. Among them, there is one my own modules, a ‘common’ one, where some common functionality is implemented.

My question is: What would be a better practice for common dependencies: Define them all explicitly in the parent, like I currently do? Or define them in a ‘common’ module, which other modules reference, and then rely on transitivity (like a single-entry-point for common dependencies)?

  • 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-24T02:23:45+00:00Added an answer on May 24, 2026 at 2:23 am

    It’s best to use the dependencyManagement tag in your parent pom to define your dependencies and their versions then reference these dependencies in your sub modules where needed. When you require other sub modules in your project (ie your common submodule from another submodule) then the dependencies will be found transitively. For example:

    In your parent pom:

    <dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.7</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </dependencyManagement>
    

    In your common pom (notice there is no version or scope):

    <dependencies>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
      </dependency>
    </dependencies>
    

    And then you can just reference your common submodule from other submodules are you are already.

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

Sidebar

Related Questions

I have searched far and wide on the Internet but have not found anything
i have searched the web relentlessly for this and have not found anything -
I have searched through stackoverflow and has found similar question. As I am still
I have searched but cant find this question anywhere. My wife and I are
I hope this is not a completely stupid question. I have searched quite a
I believe the title already says it all, but here is my question: what
Ok, so I have searched in many places for the answer to this question,
There are 2 parts to my question but both are related. I have searched
I have searched around, and it seems that this is a limitation in MS
I have searched but apparently my google foo is weak. What I need is

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.