On Thu, Jan 10, 2019 at 09:14:45AM -0500, Mark H. Wood wrote: > I try always to declare all direct dependencies, regardless of whether > they are also transitive dependencies (today). > > One reason for this is that it improves the documentation of the > project. Not only does it provide useful information to reporting > tools driven by Maven, but you can learn useful things about a project > by just reading the POM. > > Another reason is that I'm uncomfortable relying on the inclusion of > direct dependencies by happenstance. An upgraded dependency, which > *was* pulling in another direct dependency but does no more, can break > the build in a way that is quite avoidable.
A third reason is that it gives you a chance to specify what versions of your dependencies are used, instead of letting other dependencies set (and change!) those versions. Use with caution: there may be strong reasons for those other dependencies to require the versions that they do. If you have an assembly composed from multiple complex projects, you may be able to harmonize versions of shared dependencies instead of ending up with multiple versions of the same artifact and wondering which one is used. -- Mark H. Wood Lead Technology Analyst University Library Indiana University - Purdue University Indianapolis 755 W. Michigan Street Indianapolis, IN 46202 317-274-0749 www.ulib.iupui.edu
signature.asc
Description: PGP signature