简体   繁体   English

如何在 spring 引导中使用替代 pom.xml?

[英]How to use an alternative pom.xml in spring boot?

I am building a production level project and I have 2 pom.xml files,one is pom.xml and another is pom.api.xml .I have different dependencies installed in both the files.Now even after building the pom.api.xml file,I am not able to use the dependencies I installed in it.I am only able to use the dependencies installed in pom.xml . I am building a production level project and I have 2 pom.xml files,one is pom.xml and another is pom.api.xml .I have different dependencies installed in both the files.Now even after building the pom.api.xml文件,我无法使用我安装在其中的依赖项。我只能使用安装在pom.xml中的依赖项。 How could I use the dependencies in pom.api.xml in all the project files like controllers,services etc?如何在控制器、服务等所有项目文件中使用pom.api.xml中的依赖项?

Thanks!谢谢!

You can use Java 9 modularity to address it.您可以使用 Java 9 模块化来解决它。 Use a root pom to include other poms and their dependencies.使用根 pom 来包含其他 pom 及其依赖项。 Reference - https://www.baeldung.com/java-9-modularity参考 - https://www.baeldung.com/java-9-modularity

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM