I just experienced a case of two direct dependencies of my maven project having two different versions of a particular transitive dependency.
In my particular case I had
@Vitaly
my quickly hand-made command line to detect multiple versions of the same dependency :
mvn dependency:tree | grep ":compile" | sed 's/.* \(.*\):compile/\1/' | sort -u | cut -d ':' -f '1 2' | uniq -c | grep -vE "^ *1"
then, we can use the following command line to get used versions of theses dependencies (it isn't an optimized command line ;) :
for dep in $(mvn dependency:tree | grep ":compile" | sed 's/.* \(.*\):compile/\1/' | sort -u | cut -d ':' -f '1 2' | uniq -c | grep -vE "^ *1" | cut -d ' ' -f 8);
do
echo $dep;
mvn dependency:tree | grep $dep;
echo
done