如何生成effective-pom
阅读原文时间:2023年07月08日阅读:1

effective-pom是什么?我们知道任何一个项目的pom都至少继承了maven内置的超级pom,有些项目中的用户还会配置自己的继承层次,也就是说,但从当前的pom是无法全面了解项目信息的,你必须同时查看所有父pom. maven有一个effective pom的概念,它表示一个合并整个继承机构所有信息的POM,假如项目A继承自项目B,而项目B又继承自超级POM,那么A的Effectiv POM 就包含了所有A,B一级超级POM的配置,有了Effectve POM,用户就能一次得到完成的POM信息.

Maven用户使用命令行获取effective-pom,在termal中进入当前pom所在的文件夹(cd 命令)

$ mvn help:effective-pom

Effective POMs, after inheritance, interpolation, and profiles are applied:


http://maven.apache.org/POM/4.0.0 https://maven.apache.org/ xsd/maven-4.0.0.xsd"> 4.0.0 com.juvenxu.mvnbook.account account-parent 1.0.0-SNAPSHOT com.juvenxu.mvnbook.account account-captcha 1.0.0-SNAPSHOT Account Captcha 4.7 2.3 1.8 1.8 1.8 2.5.6 org.springframework spring-core 2.5.6 org.springframework spring-beans 2.5.6 org.springframework spring-context 2.5.6 org.springframework spring-context-support 2.5.6 org.springframework spring-web 2.5.6 junit junit 4.7 test com.google.code.kaptcha kaptcha 2.3 jdk15 compile org.springframework spring-core 2.5.6 compile org.springframework spring-beans 2.5.6 compile org.springframework spring-context 2.5.6 compile junit junit 4.7 test true false sonatype-forge Sonatype Forge http://repository.sonatype.org/content/groups/forge/ false central Central Repository https://repo.maven.apache.org/maven2 never false central Central Repository https://repo.maven.apache.org/maven2 ¨C11C ¨C12C

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.310 s
[INFO] Finished at: 2020-12-16T11:21:50+08:00
[INFO] ------------------------------------------------------------------------