-
Notifications
You must be signed in to change notification settings - Fork 321
Open
Description
jmolecules documents @Module( value = "..." )
as an alias for name
Given
modules().definedByAnnotation(Module.class).should().beFreeOfCycles().check(javaClasses);
When
@Module("Annotations")
@InfrastructureLayer
@NullMarked
package com.myorg.annotation;
import org.jmolecules.architecture.layered.InfrastructureLayer;
import org.jmolecules.ddd.annotation.Module;
import org.jspecify.annotations.NullMarked;
@NullMarked
@Module("Utilities")
@InfrastructureLayer
package com.myorg.tool;
import org.jmolecules.architecture.layered.InfrastructureLayer;
import org.jmolecules.ddd.annotation.Module;
import org.jspecify.annotations.NullMarked;
Then
this is a hard to debug issue, since it doesn't identify the package or anything
Found multiple modules with the same name: []
java.lang.IllegalArgumentException: Found multiple modules with the same name: []
at com.tngtech.archunit.library.modules.ArchModules.groupBy(ArchModules.java:105)
at com.tngtech.archunit.library.modules.ArchModules.<init>(ArchModules.java:82)
at com.tngtech.archunit.library.modules.ArchModules.<init>(ArchModules.java:76)
at com.tngtech.archunit.library.modules.ArchModules$Creator$WithGenericDescriptor.modularize(ArchModules.java:567)
at com.tngtech.archunit.library.modules.syntax.ModuleRuleDefinition$Creator.lambda$definedByAnnotation$0(ModuleRuleDefinition.java:82)
at com.tngtech.archunit.library.modules.syntax.ModulesTransformer.transform(ModulesTransformer.java:52)
at com.tngtech.archunit.lang.ArchRule$Factory$SimpleArchRule.evaluate(ArchRule.java:180)
at com.tngtech.archunit.lang.ArchRule$Assertions.check(ArchRule.java:84)
It would be useful to be able to define what field to read the name from as well as perhaps respecting "value" by default. At the very least printing out the conflicting "id's" (package names) and that the name field is null as I find that I should have been looking at the Module.name field confusing; and had to run the debugger. My other developers spent hours trying to figure this out and failed.
Metadata
Metadata
Assignees
Labels
No labels