dependencies - What are the preferred steps to avoid Dependency Hell in Java? -
recently in pretty trouble dependency hell problem in java. there proper set of procedures avoid in future?
first, use dependency manager maven or gradle. no lib
folder contains third party jars, no copying classes or *.java files other project yours. sorry if obvious saw lot of projects built using such technique.
the next phase optimization of dependencies. can use library , b both use library c. fine if both use library c of same version. hell starts if depend on different versions of library c. in cases not cause problem , can not aware on fact. may cause problems. avoid i'd recommend time time check dependency tree of project, find duplicates , if exist use exclude instruction of dependency manager exclude older version.
this can fail because, of incompatibility of these versions of library. in case there no general way solve problem. have downgrade 1 (or several) of dependencies in order make them work , wait newer version uses newer version of library c (in our example).
the luck of java programmers in 2016 of tools typically open source , lot of them available contributions (e.g. via github), can contribute fix , , other developers newer version faster.
Comments
Post a Comment