Closed stefanzilske closed 1 year ago
I created a small example: https://github.com/stefanzilske/kotlin-jmolecules-archunit/tree/develop
If you build the project, you will see that the archunit test passes, even though there is a dependency from the domain model ring to the infrastructure ring. If you go to the two classes and add (uncomment) the @DomainModelRing
and @InfrastructureRing
directly, the test will fail.
Hey, could somebody take a look at this? @odrotbohm maybe?
I tried ./gradlew test
on your project, and it looks like the package-info.java
files are not compiled. So I guess it's an issue with Gradle / Kotlin?
Uh, it seems you are right. I added a Maven pom.xml file and when I build the project with Maven, it seems that it works and the test is failing.
That sucks, because I have running examples, that are built with Maven und still the tests do not work. So I have to take a look again.
@odrotbohm thank you for pointing me into the right direction. I figured out that for my Maven based Kotlin projects java-compile was enabled, but sourceDirectory not set to src/main/kotlin.
Now it's working again as expected.
I am using jmolecules together with Kotlin and so far, I could place ring annotations (e.g.
@DomainModelRing
) insidepackage-info.java
files (package-info.kt
never worked), which where then considered properly by an ArchUnit test usingJMoleculesArchitectureRules#ensureOnionClassical
.Now with upgrading to jmoleclues 2023.1.1 and archunit 1.1 it seems that this is not working anymore, I have to annotate all classes directly, in order to make the test work properly. Otherwise the test will always be green, even if there are obvious violations.
Is this a known issue (couldn't find one), am I using it wrong? Any workarounds?
Thanks and keep up the great work! Stefan
Edit: If needed I can setup a small example, but maybe someone can answer this without.