When a dependency is missing a version, look at the parent

Dependency information is inherited from parents in Maven
configurations; Child projects can repeat the dependencies declared
in the parent project when they need to configure them, but in that
case, the version need not be specified again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When dependencies are missing versions, look into the dependencyManagement

In the upcoming pom-scijava version, we have a big dependencyManagement
section that preconfigures the dependency versions so that child projects
need not specify the versions but inherit pom-scijava's setting.

Let's support that in MiniMaven.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Introduce a new, protected constructor for Coordinates

This constructor requires values to be provided for *all* fields. It
is not intended to be public API so that we can use it to enforce
the use of the full constructor inside MiniMaven.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Make sure that expand(Coordinate) does not forget exclusions

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Refactor findVersion()

The findVersion() method is supposed to traverse the
<dependencyManagement> and also the parents' <dependencies> and
<dependencyManagement> sections to find the appropriate <version> tag
for dependencies whose version is not set in the current project's
<dependencies> section.

But the method itself was conflating two concepts: querying the
dependencyManagement information, and returning just one version.

For exclusions, we require the first concept: to query the
dependencyManagement information (because Bio-Formats' kryo dependency
has exclusions managed that way).

So let's refactor it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Handle <exclusions> properly

We tried to punt on the issue and just filter dependencies *after*
gathering them.

That did not work, however: if a dependency has exclusions, the
*transitive* dependencies of the excluded ones *also* need to be
excluded.

So let's stop punting on the issue and do it properly.

While at it, heed exclusions declared in <dependencyManagement>
sections as well as exclusions declared in the parents.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Move a couple of methods into a dedicated TestUtils class

Incidentally, this fixes a problem where the temporary directories were
not created in the target/ directory.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Refactor the initialisation of test MavenProjects

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Use simpler way to write pom.xml files for exclusions test

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Move more helpers into TestUtils

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Use static imports

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Make sure that transitive dependencies of excluded ones are excluded, too

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a unit test for <dependencyManagement> handling

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge pull request #2 from imagej/dependency-management

Support <dependencyManagement>