当您将mvn dependency:tree运行到某个spring引导项目时,您可以看到以下内容:
[INFO] com.example:demo:jar:1.0.0-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.0.1.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:2.0.2.RELEASE:compile
[INFO] | | \- org.springframework:spring-context:jar:5.0.6.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:5.0.6.RELEASE:compile
[INFO] | | +- org.springframework:spring-beans:jar:5.0.6.RELEASE:compile
[INFO] | | \- org.springframework:spring-expression:jar:5.0.6.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.2.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:2.0.2.RELEASE:compile
[INFO] | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.10.0:compile
[INFO] | | | \- org.apache.logging.log4j:log4j-api:jar:2.10.0:compile
[INFO] | | \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] | +- org.springframework:spring-core:jar:5.0.6.RELEASE:compile
[INFO] | | \- org.springframework:spring-jcl:jar:5.0.6.RELEASE:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.19:runtime当您不覆盖它时,所有工件都会从父pom获得默认版本。是否有一些maven命令来检查项目父级的信息(版本)?
所以当pom.xml中有
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
</parent>我想看看这样的东西
[INFO] +- org.springframework.boot:spring-boot-starter-parent:jar:2.0.1.RELEASE:compile发布于 2018-07-24 23:54:31
这不是显示您想要的确切输出,但它非常相似。
mvn -Dexec.executable='echo' -Dexec.args='${project.parent.groupId}: ${project.parent.artifactId}: ${project.parent.version}' --non-recursive exec:exec -q 在Ubuntu上进行了测试,它在我的机器上展示了这样的东西:
org.springframework.boot: spring-boot-starter-parent: 1.5.9.RELEASE
-q:静默输出,只显示错误
https://stackoverflow.com/questions/51508414
复制相似问题