Добрый вечер,
В процессе миграции kotlin-проекта на jmix 3.0 столкнулись со следующей проблемой - в тестах и зависимых модулях перестали работать extension-методы. При компиляции выдается ошибка “unresolved reference” при вызове таких методов. Если откатить jmix до версии 2.8.2 проект собирается корректно.
Claude Code предположил такую причину проблему и предложил рабочее решение через расширение gradle-задач enhanceJmix:
It's not Kotlin or Spring Boot 4 — it's the Jmix 3.0 Gradle plugin's new out-of-place entity enhancing.
In Jmix 2.x, enhancing rewrote classes in place in build/classes/java/main. In 3.0, EnhancingAction instead:
1. copies **/*.class only from the compiler output into build/classes/jmix/<sourceSet>, and
2. replaces sourceSets.<name>.output.classesDirs with just that directory.
Meanwhile the plugin also points compileKotlin.destinationDirectory at build/classes/java/main, so Kotlin writes META-INF/<module>.kotlin_module there. That file doesn't match **/*.class, so it
never reaches build/classes/jmix/main — and therefore never reaches the jar or the classes variant that other subprojects compile against.
Fix
Added to the subprojects block in build.gradle:57: a doLast on each enhanceJmix* task that copies META-INF/*.kotlin_module from the Kotlin output into build/classes/jmix/<sourceSet>. Hooking the
enhance task (rather than just jar) matters — sibling modules compile against the classes directory, not the jar, so a jar-only fix wouldn't repair the local build.