简体   繁体   English

IntelliJ 中的多模块项目

[英]Multi-module project in IntelliJ

Sorry about the question if it is stupid, but how actually i should build my multi-module project in Java, so I can have two runnable applications inside it?抱歉这个问题很愚蠢,但实际上我应该如何在 Java 中构建我的多模块项目,这样我就可以在其中有两个可运行的应用程序? For example I have three modules: 1.Models(Entities) 2.App(SpringBoot Application using #1) - runnable 3.Tests App(SpringBoot App with some Postman endpoints for testing the #2 with using #1) - runnable例如,我有三个模块: 1.Models(Entities) 2.App(SpringBoot Application using #1) - runnable 3.Tests App(SpringBoot App,带有一些 Postman 端点,用于使用 #1 测试 #2) - 可运行

Actually I am trying to build everything to be maven-dockerized, but i got stuck:/ especially with the POM files.实际上,我正在尝试将所有内容构建为 maven-dockerized,但我被卡住了:/尤其是 POM 文件。 I've created a empty maven project and started inserting the other ones.我创建了一个空的 maven 项目并开始插入其他项目。 I succeeded to run the test application with a controller, but when I try to run the #2 app it starts and stops with code 0. What am I doing wrong?我成功地使用 controller 运行了测试应用程序,但是当我尝试运行 #2 应用程序时,它以代码 0 启动和停止。我做错了什么?

you can create an empty module and add your common maven libraries for all modules into that pom.xml file and after that create modules on that.您可以创建一个空模块并将所有模块的通用 maven 库添加到该 pom.xml 文件中,然后在其上创建模块。 if you want to add specific libraries for the sub module you can add them into the sub module.如果要为子模块添加特定的库,可以将它们添加到子模块中。 if you have any doubts please refer to this.如果您有任何疑问,请参阅此。 https://youtu.be/yVzi3wuTUE4 https://youtu.be/yVzi3wuTUE4

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

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