在cmd窗口下,到maven工程的根目录下,执行mvn dependency:tree
命令,可以查看maven工程的依赖树信息。例如:
如果输出的信息很长,要仔细看,可以将输出信息定向到一个文件中,例如执行命令mvn dependency:tree > test.txt
可以将输出信息重定向到当前目录下的test.txt文件中:
打开test.txt文件,可以看到输出的内容:
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------------< com.example:demo >--------------------------
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.6.1:tree (default-cli) @ demo ---
[INFO] com.example:demo:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-webflux:jar:3.2.1:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:3.2.1:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:3.2.1:compile
[INFO] | | | \- org.springframework:spring-context:jar:6.1.2:compile
[INFO] | | | +- org.springframework:spring-aop:jar:6.1.2:compile
[INFO] | | | \- org.springframework:spring-expression:jar:6.1.2:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:3.2.1:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:3.2.1:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.4.14:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.4.14:compile
[INFO] | | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.21.1:compile
[INFO] | | | | \- org.apache.logging.log4j:log4j-api:jar:2.21.1:compile
[INFO] | | | \- org.slf4j:jul-to-slf4j:jar:2.0.9:compile
[INFO] | | +- jakarta.annotation:jakarta.annotation-api:jar:2.1.1:compile
[INFO] | | \- org.yaml:snakeyaml:jar:2.2:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:3.2.1:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.15.3:compile
[INFO] | | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.15.3:compile
[INFO] | | | \- com.fasterxml.jackson.core:jackson-core:jar:2.15.3:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.15.3:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.15.3:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.15.3:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-reactor-netty:jar:3.2.1:compile
[INFO] | | \- io.projectreactor.netty:reactor-netty-http:jar:1.1.14:compile
[INFO] | | +- io.netty:netty-codec-http:jar:4.1.104.Final:compile
[INFO] | | | +- io.netty:netty-common:jar:4.1.104.Final:compile
[INFO] | | | +- io.netty:netty-buffer:jar:4.1.104.Final:compile
[INFO] | | | +- io.netty:netty-transport:jar:4.1.104.Final:compile
[INFO] | | | +- io.netty:netty-codec:jar:4.1.104.Final:compile
[INFO] | | | \- io.netty:netty-handler:jar:4.1.104.Final:compile
[INFO] | | +- io.netty:netty-codec-http2:jar:4.1.104.Final:compile
[INFO] | | +- io.netty:netty-resolver-dns:jar:4.1.104.Final:compile
[INFO] | | | +- io.netty:netty-resolver:jar:4.1.104.Final:compile
[INFO] | | | \- io.netty:netty-codec-dns:jar:4.1.104.Final:compile
[INFO] | | +- io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64:4.1.104.Final:compile
[INFO] | | | \- io.netty:netty-resolver-dns-classes-macos:jar:4.1.104.Final:compile
[INFO] | | +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.104.Final:compile
[INFO] | | | +- io.netty:netty-transport-native-unix-common:jar:4.1.104.Final:compile
[INFO] | | | \- io.netty:netty-transport-classes-epoll:jar:4.1.104.Final:compile
[INFO] | | \- io.projectreactor.netty:reactor-netty-core:jar:1.1.14:compile
[INFO] | | \- io.netty:netty-handler-proxy:jar:4.1.104.Final:compile
[INFO] | | \- io.netty:netty-codec-socks:jar:4.1.104.Final:compile
[INFO] | +- org.springframework:spring-web:jar:6.1.2:compile
[INFO] | | \- org.springframework:spring-beans:jar:6.1.2:compile
[INFO] | \- org.springframework:spring-webflux:jar:6.1.2:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:3.2.1:compile
[INFO] | +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:3.2.1:compile
[INFO] | | \- org.springframework.boot:spring-boot-actuator:jar:3.2.1:compile
[INFO] | +- io.micrometer:micrometer-observation:jar:1.12.1:compile
[INFO] | | \- io.micrometer:micrometer-commons:jar:1.12.1:compile
[INFO] | \- io.micrometer:micrometer-jakarta9:jar:1.12.1:compile
[INFO] | \- io.micrometer:micrometer-core:jar:1.12.1:compile
[INFO] | +- org.hdrhistogram:HdrHistogram:jar:2.1.12:runtime
[INFO] | \- org.latencyutils:LatencyUtils:jar:2.0.3:runtime
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:3.2.1:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:3.2.1:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:3.2.1:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.8.0:test
[INFO] | | \- org.slf4j:slf4j-api:jar:2.0.9:compile
[INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:4.0.1:test
[INFO] | | \- jakarta.activation:jakarta.activation-api:jar:2.1.2:test
[INFO] | +- net.minidev:json-smart:jar:2.5.0:test
[INFO] | | \- net.minidev:accessors-smart:jar:2.5.0:test
[INFO] | | \- org.ow2.asm:asm:jar:9.3:test
[INFO] | +- org.assertj:assertj-core:jar:3.24.2:test
[INFO] | | \- net.bytebuddy:byte-buddy:jar:1.14.10:test
[INFO] | +- org.awaitility:awaitility:jar:4.2.0:test
[INFO] | +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] | +- org.junit.jupiter:junit-jupiter:jar:5.10.1:test
[INFO] | | +- org.junit.jupiter:junit-jupiter-api:jar:5.10.1:test
[INFO] | | | +- org.opentest4j:opentest4j:jar:1.3.0:test
[INFO] | | | +- org.junit.platform:junit-platform-commons:jar:1.10.1:test
[INFO] | | | \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] | | +- org.junit.jupiter:junit-jupiter-params:jar:5.10.1:test
[INFO] | | \- org.junit.jupiter:junit-jupiter-engine:jar:5.10.1:test
[INFO] | | \- org.junit.platform:junit-platform-engine:jar:1.10.1:test
[INFO] | +- org.mockito:mockito-core:jar:5.7.0:test
[INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.14.10:test
[INFO] | | \- org.objenesis:objenesis:jar:3.3:test
[INFO] | +- org.mockito:mockito-junit-jupiter:jar:5.7.0:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.5.1:test
[INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] | +- org.springframework:spring-core:jar:6.1.2:compile
[INFO] | | \- org.springframework:spring-jcl:jar:6.1.2:compile
[INFO] | +- org.springframework:spring-test:jar:6.1.2:test
[INFO] | \- org.xmlunit:xmlunit-core:jar:2.9.1:test
[INFO] \- io.projectreactor:reactor-test:jar:3.6.1:test
[INFO] \- io.projectreactor:reactor-core:jar:3.6.1:compile
[INFO] \- org.reactivestreams:reactive-streams:jar:1.0.4:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.219 s
[INFO] Finished at: 2024-01-20T12:10:36+08:00
[INFO] ------------------------------------------------------------------------