如何使用“依赖关系结构矩阵”和其他工具来分析IDEA中的依赖关系。

此翻译是IntelliJ IDEA系列的继续:
依赖矩阵
此功能仅在IntelliJ IDEA Ultimate中可用,而在Community版本中不可用。
IDEA , . , .
, , .
(Dependency Structure Matrix DSM) . -, build . , , «Analyze → Analyze Dependency Matrix...». IDEA Ultimate DSM Analysis.
:

, .

IDEA , , , .
. — . . , . , . 99 , ... .
, , . , . .
, . , . . , , .
, , .

, . ( ), IDEA .

, , . , , .
, . , . , .

. , , , . , .
DSM , , . , .

. , , . DSM :

, Owner 15 Pet, Pet 5 Owner.
DSM IDEA — , , .
DSM. , Find usages for dependencies. IDEA / , / .
, . service, - vet. :

, .
Maven
IntelliJ IDEA Ultimate, Community .
. , , . . , , ( ). , . Maven , . :
mvn dependency:tree -Dverbose -DoutputFile=dependencies.txt
Maven , ( ):
com.vojtechruzicka:spring-boot-actuator-example:jar:1.0.0-SNAPSHOT
+- org.springframework.boot:spring-boot-starter-actuator:jar:2.0.3.RELEASE:compile
| +- org.springframework.boot:spring-boot-starter:jar:2.0.3.RELEASE:compile
| | +- org.springframework.boot:spring-boot:jar:2.0.3.RELEASE:compile
| | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.3.RELEASE:compile
| | +- org.springframework.boot:spring-boot-starter-logging:jar:2.0.3.RELEASE:compile
| | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
| | | | \- ch.qos.logback:logback-core:jar:1.2.3:compile
| | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.10.0:compile
| | | | \- org.apache.logging.log4j:log4j-api:jar:2.10.0:compile
| | | \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
| | +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
| | \- org.yaml:snakeyaml:jar:1.19:runtime
, , , graphml tgf.
, , .
: verbose maven 3.x, Maven 2 .
, IDEA Maven. IntelliJ, 2019.1 , .
, pom.xml Shift + Ctrl + Alt + U ( ⌥ + ⇧ + ⌘ + U Mac). → Diagrams → Show Dependencies.
, , . . , Find , Ctrl + F.

, . , , .
— . , .

, , , Shift.
, .

IDEA . , , - . , :

JUnit. JUnit 3.8.1 , spring-boot-starter-test.
Maven Helper
, , . Maven Helper Vojtech Krasa. , mvn dependency:tree, .
, IDEA Community Edition IDEA, Maven .
, , pom.xml. Dependency Analyzer, .

( ). , . , .
Gradle
2019.2, IDEA Maven, Gradle. ! , Maven.
build.gradle Shift + Ctrl + Alt + U ( ⌥ + ⇧ + ⌘ + U Mac). → Diagrams → Show Dependencies.
当您创建应用程序时,正确构建依赖关系非常重要,因为具有困难且令人困惑的依赖关系的体系结构可能很难维护,扩展和修改。幸运的是,IDEA可以帮助解决结构依赖性矩阵,该矩阵提供了内部依赖性的有用图形表示。
除此之外,还必须确保还涵盖了外部依赖关系,这可以通过将依赖关系图用于您的依赖关系管理系统(例如Maven)来实现。