[英]How should i structure a multi component Java project using Maven and Intelij?
my java se project/system consists of multiple components like below where there can be many shared libs and many applications/ running processes. 我的java se项目/系统由下面的多个组件组成,其中可以有许多共享库和许多应用程序/运行进程。 Example the 3 components below make up 'System 1'.
示例下面的3个组件组成'系统1'。
System 1: 1. Common lib - for our shared code 2. App 1 - a app/process with it's own code referencing the common lib. 系统1:1。通用库 - 用于我们的共享代码2.应用程序1 - 一个应用程序/进程,它自己的代码引用公共库。 3. App 2 - a app/process with it's own code referencing the common lib.
3.应用程序2 - 一个应用程序/进程,它自己的代码引用了公共库。
My questions how do i setup Maven/Intelij to support this structure ... and is it a good structure to follow? 我的问题是如何设置Maven / Intelij来支持这种结构......它是一个很好的结构吗?
At present I have the groupId as 'com.MyCompany.System1' and the Mavan modules for the components with artifactIds as 'com-MyCompany-System1-common' etc. 目前我将groupId作为'com.MyCompany.System1',将具有artifactIds的组件的Mavan模块作为'com-MyCompany-System1-common'等。
Is this the correct way to go or how should i arrange Maven to support this structure? 这是正确的方法,我应该如何安排Maven支持这种结构?
Thanks in advance. 提前致谢。
It sounds like a typical Maven multi-module setup should serve your needs. 听起来像典型的Maven多模块设置应该满足您的需求。 As for IntelliJ, just set it up in Maven and then import the maven pom into IntelliJ.
至于IntelliJ,只需在Maven中设置它,然后将maven pom导入IntelliJ。 It'll just work.
它会起作用。 You can just open the pom file as a project, and IntelliJ will set everything up for you correctly.
您可以将pom文件作为项目打开,IntelliJ将为您正确设置所有内容。
Advice: 建议:
Source: I have a mix of >100 Maven and Gradle modules spread across >30 source code repos which I've been building and working in with IntelliJ for 3 years. 资料来源:我有超过100个Maven和Gradle模块的混合,分布在30多个源代码回购中,我用IntelliJ工作了3年。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.