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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:18:21+00:00 2026-06-13T04:18:21+00:00

A lot of open source projects like spring consist of multiple modules, when adding

  • 0

A lot of open source projects like spring consist of multiple modules, when adding those modules as dependencies in maven should I explicitly defined every dependency or just let the transitive dependency management do its thing. For example which of the two cases below is a best practice.

case 1: Include the highest level features that I want

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>3.1.2.RELEASE</version>
    </dependency>

case 2: Include each part of the framework as an explicit dependency

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.1.2.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.1.2.RELEASE</version>
    </dependency>
            .... other dependencies that are transitively resolved by maven
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>3.1.2.RELEASE</version>
    </dependency>

Which is the best practice case 1 or case 2 and why?

  • 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-13T04:18:23+00:00Added an answer on June 13, 2026 at 4:18 am

    It depends on if you are declaring any other dependencies that use the same dependencies (in this case, Spring). If all you need is the top-level dependency, declare that. If you are using other dependencies that rely on specific versions of a transitive dependency, declare that as an explicit dependency.

    Using Spring as an example: If you declare spring-webmvc and then later decide you need another spring package, say spring-security, it may be a good idea to explicitly define any shared dependencies that they both rely on, just so you know which version is being included with your project.

    Basically, declare anything that you need a specific version of and let maven take care of the rest until you either need to exclude versions or declare specific versions. This is what maven is built to do, so let it manage the dependencies until it makes a wrong decision.

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

Sidebar

Related Questions

There are a lot of great open-source projects on github. Most of them come
There are a lot of open source C/C++ projects, most of them can be
I have read a lot of popular standards manuals for open source PHP projects.
I'm using a open-source Python library in my project. This library logs a lot
I know that there's a lot of free open source blog engine out there
Do any of you know of a website which lists open source projects which
I'm looking for recommendations for open-source projects written in C++ that will help me
I am interested to join an Open Source project using .net; I would like
In my resume I have a list of open source projects I've contributed to.
I would like to contribute to an open-source Windows Mobile project, but it's being

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.