0

I am trying to understand "Dependency management" Tab which is shown in eclipse IDE for pom.xml (in GUI). For ready reference, here is the screen shot:

enter image description here

In my pom, I kept two "direct" dependencies viz: spring-core and spring-context.

In left panel (marked with "Dependencies") ; I believe this illustrates that face.

What is "Dependency Management" right side panel? How can I understand this in an easy to follow manner?

halfer
  • 19,824
  • 17
  • 99
  • 186
CuriousMind
  • 8,301
  • 22
  • 65
  • 134

1 Answers1

1

It corresponds to the <dependencyManagement> section of your pom. <dependencyManagement> entries are used to set standard versions for artifacts. You can read them as "If I have a transitive dependency on artifact X, then the version should be Y". Furthermore, you can leave out the version tag in your <dependencies> if the version can be drawn from <dependencyManagement>.

See also Differences between dependencyManagement and dependencies in Maven

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
  • Thanks for your reply. So, if I use , then I don't need to mention the versions for the dependencies, I tried that and I could see it is taking dependencies versions of its own. But how does it get those version details. Does it get the latest once which are available in central repo? Please clarify. – CuriousMind Nov 04 '18 at 03:07
  • I do not really understand what you mean. If you put a version number into the dependency management, this number replaces the version in your versionless dependencies and your transitive dependencies. DependencyManagement does not look up anything in central. Which "version details" are you talking about? Could you give an example? – J Fabian Meier Nov 04 '18 at 08:50