Java project dependencies

Suppose I have a dynamic web project named A. This project A has a dependency on another project named B that uses the Dom4J jar. If B adds this jar as a dependency, and I add project B to the build path of project A, and project B has a method that throws a Dom4J exception, how can I avoid adding Dom4J as a dependency in project A, so I don’t have Is Dom4J Dependent In Both Projects?

+4
source share
2 answers

If your code directly calls a method that declares a Dom4jException throw, you need to have Dom4j in your build class path. This is only part of the method signature, and the compiler should be able to enable it.

(.. Dom4j " " B), , API Project B Dom4j. , throws, .

, , Project A Project B, Dom4J . , . , Dom4J .

, Maven . Dom4J , . , , Dom4J (, ).

+4

, A dom4j. B, dom4j. B .

0

Source: https://habr.com/ru/post/1616330/


All Articles