2

I'm looking at a project's POM and its dependency management section lists the same artifact 3 times - each time with different classifiers/types. What does this help you achieve?

Specifically, the dependency in question is the test module of the project. Its 3 occurrences in the POM have the following form:

  1. default scope, default type, default classifier
  2. default scope, test-jar type, default classifier
  3. default scope, test-jar type, test-sources classifier
Miro
  • 135
  • 1
  • 3
  • 9
  • This has two advantages: 1) Avoiding the need for all projects that inherit from that parent to declare the version when they need to depend on one of these artifacts. 2) Ease the management of version changes for these dependencies, you only have to change the version in one place. – Tome Sep 05 '13 at 14:54

1 Answers1

0

Dependency management helps organizing your dependencies in a central place. In your case, that particular artifact is going to be used in different forms in different modules:

  1. Plain dependency
  2. Share the test code with the module that depends on it (test dependency) - Same for 3
Amir Keibi
  • 1,991
  • 28
  • 45
  • 1
    You're right. I thought that if I don't specify any type/classifier in the dependency management, I can still specify it in the child POM while referring to the version from the dependency management, which is not how it works. – Miro Sep 07 '13 at 12:38