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.
我有一种情况,在环境 AI 中,我想在服务中使用 maven BOM-A 作为其依赖项,而在环境 B 中,我想在同一服务中使用 maven BOM-B 作为其依赖项。如何根据属性/配置文件区分要导入的 BOM-*?
您可以将 dependencyManagement 条目放入配置文件中,但如果您总是想为两个平台构建类似的项目,您也可以考虑创建一个多模块项目。
然后您将拥有module-A,module-B和common, 这样大部分代码和配置都在common其中,并且特定于环境的 POM 条目在其他模块中
module-A
module-B
common