Closed breun closed 2 weeks ago
@BoundedContext
and @Module
were added to jmolecules-ddd
via https://github.com/xmolecules/jmolecules/issues/20, but weren't added to kmolecules-ddd
. I've created https://github.com/xmolecules/jmolecules/issues/126 for this.
I'm now thinking that these annotations are probably missing from kmolecules-ddd
, because these are package-level annotations and Kotlin doesn't provide a way to define package-level annotations.
Maybe it's then best to let Spring Modulith not fail when org.jmolecules.ddd.annotation.Module
is not present?
An improve guard should be in place. Feel free to give the snapshots a try!
I'm trying out Spring Modulith 1.2.3 with a Spring Boot 3.3.3 project that is written in Kotlin. On the Verifying Application Module Structure page I read about jMolecules, and I found that
jmolecules-ddd
has a Kotlin counterpart called kmolecules-ddd.However, after adding
org.jmolecules:kmolecules-ddd
to my project, I gotjava.lang.NoClassDefFoundError: org/jmolecules/ddd/annotation/Module
when callingorg.springframework.modulith.core.ApplicationModuleInformation#of
for Spring Modulith application module verification and documentation generation.This seems to happen because
JMoleculesTypes.isPresent()
returnstrue
, becauseorg.jmolecules.ddd.annotation.Entity
is present (provided bykmolecules-ddd
), butJMoleculesModule.supports(lookup)
then tries to look uporg.jmolecules.ddd.annotation.Module
, which is not provided bykmolecules-ddd
(although it is indeed provided byjmolecules-ddd
).