Coming from Spring Modulith
Most declarations move over by changing imports. Spring Modulith’s own annotations keep working too: with
quarkus.modulith.spring-annotations.enabled (the default) the build reads org.springframework.modulith annotations
from the class files, so a code base can migrate step by step without Spring at runtime.
| Spring Modulith | Quarkus Modulith |
|---|---|
|
|
|
|
|
|
jMolecules |
read the same way |
|
|
|
|
|
same names in |
|
|
|
|
|
|
|
same names in |
|
|
|
done by the build, see Documentation, endpoint and Dev UI |
|
|
|
|
|
|
|
|
|
same names in |
|
|
|
|
|
|
|
|
Differences
-
Verification runs during the build and fails it by default. Spring Modulith verifies in a test, which also works here with
ApplicationModules.of. -
Test classes are left out of the model, like Spring Modulith’s default.
-
The model API returns
JavaTypeandJavaPackagewhere Spring Modulith returns ArchUnit types, so the runtime does not need ArchUnit. A few methods kept their earlier Quarkus Modulith return types and offer Spring’s under another name:ApplicationModule.getJavaPackage()(Spring’sgetBasePackage()),getNamedInterfaceDetails()(getNamedInterfaces()),getPublishedEventTypes()(getPublishedEvents()),getBeans()(getSpringBeans(), still available) andApplicationModules.getObjectComparator()(getComparator()). -
Field injection of beans of other modules is allowed by default, because it is the common style in Quarkus. Set
quarkus.modulith.verification.allow-field-injection=falsefor Spring Modulith’s rule. -
Dependency descriptions follow ArchUnit’s format. Cycles are reported once per cycle, with one reference per step.
-
ApplicationModules.verify()passes once and then returns right away, but a failed verification fails again on every call. Spring Modulith verifies once per instance, and in Quarkus the instance is a bean all tests share. -
ApplicationModules.ofneedsorg.ow2.asm:asmin test scope, because the core reads class files with ASM and keeps it optional. Spring Modulith brings ArchUnit instead. -
The JSON export is written only with
quarkus.modulith.export.enabled=true, because nothing in Quarkus Modulith reads it. -
Listener conditions (
@ApplicationModuleListener(condition = …)) and@Externalizedrouting expressions are not evaluated as SpEL. The forms Spring users write are compiled to bytecode at build time, and anything else fails the build. See Module events and the outbox and Event externalization. -
Completion attempts count every delivery (
markProcessing), not every resubmission, and a resubmission claims onlyPUBLISHEDorFAILEDpublications (with takeover of stale ones). See Module events and the outbox. -
The registry stores events as JSON with the application’s Jackson mapper. There is no JSON-B fallback.
-
Namastack Outbox is a Spring Boot library and is not supported. The registry’s own outbox mode replaces it. Pulsar is not a tested transport yet. Spring Modulith 2.1.2 has no Pulsar externalization either.
-
Module tests exclude beans at build time, so each bootstrap configuration triggers a new build. Spring Modulith builds a smaller application context per test. Hibernate ORM entities of excluded modules stay mapped, see Testing modules.