谢谢你的时间,
我一直在尝试使用 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