Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Fredrik Jonson Newsgroups: comp.lang.java.programmer Subject: Re: why maven auto import commons-lang Date: 3 Jul 2013 07:01:19 GMT Lines: 23 Message-ID: References: <2bfd9773-fb9e-472a-88a8-b086fa765bc0@googlegroups.com> <05043512-9c65-4813-8b70-0809f9b6db8e@googlegroups.com> X-Trace: individual.net uulvfv2VTC8b0RM35vvVQw4/wjr+kjft8n1fAwyjOtlUDdaDw= Cancel-Lock: sha1:/nTinvvquz7zJA6f2isj7TZZTu4= User-Agent: slrn/pre1.0.0-18 (Linux) Xref: csiph.com comp.lang.java.programmer:24608 In <05043512-9c65-4813-8b70-0809f9b6db8e@googlegroups.com> Lew wrote: > Maven is usually pretty good about tracking transitive dependencies and > fetching them. Some other POM probably called for it. If that is the case I recommend that you still declare it in your own pom too, just to make it explicit for your future self and other developers that work with the project. > This works great until multiple POMs ask for different versions of the > same library. Ouch! Yes, you need to be mindful about which transitive dependencies your declared dependencies pulls in. I make it a habit to regularily check my dependencies with the command 'mvn dependency:tree'. The few cases where version mismatch occurs it can normally be handled by declaring exclusions on one of the dependencies. In my experience this happens rarely and I cant remember the last time, if ever, where I was unable to resolve it with exclusions. -- Fredrik Jonson