耽误您时间,实在对不起,
我一直在尝试使用Archunit,但我无法理解这个问题:
ComponentIntersectionException: Class
com.yyy.xxx.common.configurations.properties.SomeClass may not be contained in more
than one component, but is contained in [Common, Configuration]我有一个相当标准的工厂图;虽然我不想分享它,但可能有一些ArchUnit的细微差别,我遗漏了。我的问题是,具体地说,在高层次上,我肯定做错了什么?
附加信息:测试:
@Test
void diagram_layersShouldBeRespected() throws IOException {
classes().should(adhereToPlantUmlDiagram(PLANTUML_YAMl, consideringOnlyDependenciesInDiagram())).check(ALL_PROJECT_CLASSES);
}yaml:
@startuml
package "Config" {
[Configuration] <<..configurations.properties..>>
//this is where SomeClass resides
}
package "Web Layer" {
[Controller] <<..web.controllers..>>
[Resources] <<..web.resources..>>
}
package "Business Layer" {
[Services] <<..services..>>
[Business Model] <<..models..>>
}
package "Adapter Layer" {
[Databases] <<..dataaccess..>>
[Integration] <<..adapters.azure..>>
[Storage] <<..adapters.azure.storage..>>
}
package "Common Layer" {
[Common] <<..common..>>
}
[Configuration] --> [Services]
[Configuration] --> [Storage]
[Configuration] --> [Common]
[Configuration] --> [Configuration]
[Common] --> [Configuration]
[Controller] --> [Resources]
[Controller] --> [Services]
[Controller] --> [Common]
[Resources] --> [Common]
[Services] --> [Databases]
[Services] --> [Integration]
[Services] --> [Storage]
[Services] --> [Common]
[Databases] --> [Common]
[Integration] --> [Common]
[Storage] --> [Common]
@enduml发布于 2021-10-21 08:37:45
因为@Thomas让我思考了我的问题的根源,我已经解决了它,如下所示:
问题是,作为我对组件(A)描述的一部分的包太模糊了,以至于对另一个组件(B)的描述也可以被认为是对该组件(A)的描述,所以我的一些类被认为属于>=2组件。
https://stackoverflow.com/questions/69642374
复制相似问题