Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道 pom 中 Parent 和 BOM 之间的区别。看起来两者都解决了相同的问题,您不想在每个单独的项目中包含版本,而是将其维护在中央(父/BOM)maven中。
谁能帮我理解?谢谢你。
您只能有一个父级,但您可以将多个 BOM 导入 Maven 项目。
此外,导入 BOM 只会导入 dependencyManagement,而拥有父级将导入您在该 pom 中拥有的所有内容。
当您想为设置父级时提供一组默认配置时,这特别有用,您继承了在这些插件中完成的所有插件版本(和配置)。