laserval/Hydra — pull request #1 by remen (2013-05-27 13:33:16+00:00)
Title: Added maven-duplicate-finder-plugin and fixed (almost) all stages

Hey,

TL;DR version: this commit adds the maven-duplicate-finder-plugin to find possibly conflicting versions of logging implementation libraries. It is also a very nice plugin to have to see what could possibly break when using jar-with-dependencies.

TL version: I had a look at your changes, but I saw that there was some confusion (do we use `slf4j-simple` or not)?

Here's the deal. We need to make sure that no stage (or a dependent jar-file) includes a logging *implementation* (like e.g. `slf4j-simple`!). It is perfectly fine if they include a dependency on `slf4j-api`, since maven should take care of this and make sure that the correct version is used. If for some weird reason it doesn't, we should enforce it using dependencyManagement (which we should be using anyway, but that is a separate issue).

Now, there are a few ways that we could do exactly this (at runtime? compile time? in a test?), but in the end I went with using the `maven-duplicate-finder-plugin` to check if there are any conflicting definitions of `org.slf4j.impl.*`

The reason why your commit worked even though there were conflicts is that the assembly plugin picks an implementation "at random" (I'm guessing it's actually the first referenced dependency) when populating the jar-with-dependency classes directory. You can actually see what it is happening in the log file when building.

Anyway. I think this is the way to go. It also showed some other strange namespace conflicts (solr-in is completely broken) that I fixed.