Closed tobias- closed 5 years ago
https://github.com/tobias-/example-gradle-kotlin/tree/java_and_kotlin_problem
The base issue is that in Gradle, the Kotlin code is enhanced before the Java code has been compiled. Maven seems to do the ebean step after all classes have been compiled . This causes a lot of not found classes during Gradle build, but works with Maven.
This may have a workaround by doing some Gradle trick, but I haven't found it.
I've made a solution that works for my usecase, but there's bound to be a better way of doing it. Either way, here: https://github.com/tobias-/ebean-gradle-plugin/tree/hacky_fix_for_java_and_kotlin
Ok, the above change looks like it should be submitted as a PR and included?
Ok, made the changes as per the commit above and merged that into master as part of 11.13.1
I'll close this (but would be good for @tobias- to review if possible)
Any Kotlin code that depends on java code will fail. I will append an example shortly where the maven plugin works, but the gradle plugin fails.
Pom from: https://raw.githubusercontent.com/ebean-orm-examples/example-kotlin/master/pom.xml