我真搞不懂有人怎么会用Maven构建一些微服务。我见过很多使用多模块策略的项目
有关
- firstapplication
- seconddapplication
- thirdapplication
任何帮助都是非常感谢的。
我真的不知道这是怎么回事
[ parentpom.xml ]
|
|___first-application
| |
| |__ data-layer
| | |__ pom.xml
| |
| |__ services
| | |__ [[ USES message-queue:producer ]]
| | |
| | |__ pom.xml
| |
| |__ domain
| | |__ pom.xml
| |
| |__ application (REST)
| | |__ pom.xml
| |
| |__ pom.xml
|
|___second-application
| |
| |__ data-layer
| | |__ pom.xml
| |
| |__ services
| | |__ pom.xml
| |
| |__ domain
| | |__ pom.xml
| |
| |__ application (REST)
| | |__ pom.xml
| |
| |__ pom.xml
|
|___third-application
| |
| |__ data-layer
| | |__ pom.xml
| |
| |__ services
| | |__ [[ USES message-queue:consumer ]]
| | |
| | |__ pom.xml
| |
| |__ domain
| | |__ pom.xml
| |
| |__ application (REST)
| | |__ pom.xml
| |
| |__ pom.xml
|
|
|___message-queue (as wrapper of kafka/rabbit/etc)
| |
| |__ configuration_of_message_queue
| | |__ pom.xml
| |
| |__ consumer
| | |
| | |__ [[ USES message:queue:configuration ]]
| | |
| | |
| | |__ pom.xml
| |
| |__ producer
| | |
| | |__ [[ USES message:queue:configuration ]]
| | |
| | |
| | |__ pom.xml
| |
| |__ pom.xml
|
|
|___ commonlibrary (some projects use this, some others dont)
|__ pom.xml
<parentpom>
<modules>
<module>first</module>
<module>second</module>
<module>third</module>
<module>message-queue</module>
<module>commonlibrary</module>
</modules>
</parentpom>
发布于 2022-09-08 17:15:35
如果monorepo是一个很好的策略或多个回购(每个服务/库都有回购),那么您正在发出信号。
注:
每个独立的回购或相同的回购可以是自己的多模块项目本身。
已经有一个关于单一和多个回购的巨大争论。
两者都很适合微型服务。
很多事情都成为这个决定的影响因素。
。
如果您要使用monorepo(单存储库,所有microservices+库)
你可以在一个地方看到所有的代码。codebase
,有适当的过程是非常必要的。
如果您要进行多个回购(每个ms和libs存储库)
您需要确保按需要构建具有依赖关系的独立项目。projects.
,那么就可以很好地处理您的
。
本质上,这两种方法都是很好的方法,取决于您的团队结构、成熟度和您感到舒服的模型。
为了我们的服务,我遵循一种方式,以下是我们的结构。
├── README.md
├── db
│ └── create-dbs.sh
├── docker-compose.yaml
├── docs
│ ├── 1. Prerequisites.md
│ ├── 2. Documentation.md
│ ├── 3. Running services.md
├── pom.xml
├── services
│ ├── books-service
│ └── products-service
├── shared
│ ├── archunit-tests
│ ├── auditing-utils
│ ├── project-bom
│ ├── event-publisher
│ ├── logging-utils
│ ├── rest-clients
│ └── utils
└── templates
└── azure-template
给你的几个建议:
libraries.
。
https://stackoverflow.com/questions/73652655
复制相似问题