maven 查看外部库的版本信息
要查看外部库的版本信息,可以使用以下命令:
mvn dependency:tree
这个命令会显示项目的依赖树,其中包括了外部库的版本信息。你可以在命令行中执行这个命令,或者在项目的根目录下运行它。执行命令后,你会看到一个类似于以下的输出:
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< com.example:my-project >---------------
[INFO] Building my-project 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ my-project ---
[INFO] com.example:my-project:jar:1.0-SNAPSHOT
[INFO] +- org.springframework:spring-core:jar:5.1.4.RELEASE:compile
[INFO] | \- org.springframework:spring-jcl:jar:5.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:5.1.4.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:5.1.4.RELEASE:compile
[INFO] | \- org.springframework:spring-context:jar:5.1.4.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.1.4.RELEASE:compile
[INFO] \- junit:junit:jar:4.12:test
在这个输出中,你可以看到项目的依赖树,每个依赖项都包括了组织、模块、版本以及作用域(compile、test等)。通过查看这个依赖树,你可以找到外部库的版本信息
原文地址: https://www.cveoy.top/t/topic/iYm3 著作权归作者所有。请勿转载和采集!