[英]Quarkus multi-module cyclic reference problem
This is my first project using Quarkus.这是我第一个使用 Quarkus 的项目。
I made a multi-module project and in the parent pom I have this module structure:我做了一个多模块项目,在父 pom 中我有这个模块结构:
<modules>
<module>domain</module>
<module>application</module>
<module>client</module>
</modules>
In my domain
module I have my interfaces that are supposed to be implemented by the application
and client
modules.在我的
domain
模块中,我的接口应该由application
和client
模块实现。 So I added the <dependency>
in the application
and the client
modules, for implementing the domain
interfaces.所以我在
application
和client
模块中添加了<dependency>
,用于实现domain
接口。
But when I want to add the <dependency>
of the application
module in my domain
it doesn't work and when I build I have this error:但是,当我想在我的
domain
添加application
模块的<dependency>
时,它不起作用,并且在构建时出现此错误:
[ERROR] [ERROR] The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='com.test.name:application:0.0.1-SNAPSHOT'}' and 'Vertex{label='com.test.name:domain:0.0.1-SNAPSHOT'}' introduces to cycle in the graph com.test.name:domain:0.0.1-SNAPSHOT --> com.test.name:application:0.0.1-SNAPSHOT --> com.test.name:domain:0.0.1-SNAPSHOT @ [ERROR] The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='com.test.name:application:0.0.1-SNAPSHOT'}' and 'Vertex{label='com.test.name:domain:0.0.1-SNAPSHOT'}' introduces to cycle in the graph com.test.name:domain:0.0.1-SNAPSHOT --> com.test.name:application:0.0.1-SNAPSHOT --> com.test.name:domain:0.0.1-SNAPSHOT -> [Help 1]
[错误] [错误]反应器中的项目包含循环引用:'Vertex{label='com.test.name:application:0.0.1-SNAPSHOT'}'和'Vertex{label='com.test之间的边缘.name:domain:0.0.1-SNAPSHOT'}' 在图中引入循环 com.test.name:domain:0.0.1-SNAPSHOT --> com.test.name:application:0.0.1-SNAPSHOT -- > com.test.name:domain:0.0.1-SNAPSHOT @ [错误] 反应器中的项目包含循环引用:'Vertex{label='com.test.name:application:0.0.1-SNAPSHOT'之间的边缘}' 和 'Vertex{label='com.test.name:domain:0.0.1-SNAPSHOT'}' 在图中引入循环 com.test.name:domain:0.0.1-SNAPSHOT --> com.test .name:application:0.0.1-SNAPSHOT --> com.test.name:domain:0.0.1-SNAPSHOT -> [帮助 1]
I need this for dependency injection, my CDI container need to find the implementation to inject it.我需要这个来进行依赖注入,我的 CDI 容器需要找到注入它的实现。 Does anyone have a solution?
有没有人有办法解决吗?
The way I like to structure my projects is roughly as follows:我喜欢构建项目的方式大致如下:
domain
module.domain
模块。 They can be as fine or coarse grained as your design dictates.app-service-interfaces
(eg interfaces for the business logic), app-dao-interfaces
(interfaces for the DAO layer) etc.app-service-interfaces
(例如业务逻辑的接口)、 app-dao-interfaces
(DAO 层的接口)等。app-service-impl
depends and implement the app-service-interfaces
module, but also depends on the app-dao-interfaces
module because it needs access to the application's datastore facilities.app-service-impl
依赖并实现app-service-interfaces
模块,但也依赖于app-dao-interfaces
模块,因为它需要访问应用程序的数据存储设施。 The implementation of app-dao-interfaces
could be app-dao-jpa
, if I choose to use JPA for the DAO layer.app-dao-interfaces
的实现可以是app-dao-jpa
。 (Sidenote: keeping the interface modules free of dependencies to the actual technology used to implement them allows you to switch implementations easily.) 2 final comments: 2条最终评论:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.