codahale/dropwizard — pull request #371 by xako (2013-07-24 12:38:01+00:00)
Title: Introduce dependencyManagement for major dependencies.

This is a set of changes to the POM files that introduce dependency management for Dropwizard's main dependencies (principally, those referenced by _dropwizard-client_, _dropwizard-core_ and _dropwizard-util_).

The motivation for suggesting this change is to allow projects that interact with Dropwizard (but are not themselves Dropwizard services) to reference Dropwizard's transitive dependencies without having to find, then specify, the version number.

Currently, the only alternative to finding the dependency versions and specifying them manually is to depend on a Dropwizard artifact then exclude the long list of everything you don't need - which is rather cumbersome and also requires updating when version numbers change. If, for example, _dropwizard-client_ is referenced by a project, when that project is packaged up, it will pull in tens of megabytes of dependencies.

**Examples of why you might want to reference individual dependencies, rather than all of Dropwizard, include:**
* You want to build **common libraries**, e.g. for logging, but don't want to pull in the full Dropwizard dependency for this, only the appropriate logging library
* You want to build a Java-based **client for your Dropwizard service**, making use of Jersey and other dependencies, without depending on core Dropwizard code
* Sections of your project may be **integrated with other applications**, and those applications should not depend on all of Dropwizard

**There is also a maintenance benefit to Dropwizard itself:**
* Exclusions of managed dependencies only need to be specified **once in the parent POM**, rather than in every POM where they are referenced (e.g. the jersey-test-framework dependencies in the POMs for dropwizard-auth, dropwizard-core, dropwizard-hibernate and dropwizard-testing)

After these changes are made, projects that use Dropwizard can retrieve the versions of Dropwizard dependencies by specifying the following in their pom.xml, [as described by Apache](http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope):
```

com.codahale.dropwizard
dropwizard-parent
0.7.0-SNAPSHOT
pom
import

```

The equivalence of the managed dependency approach to the previous, unmanaged dependencies can be tested by running _mvn help:effective-pom_ against each project and comparing the dependencies section.