Possible to have Java and Kotlin classes in same package and use Maven?


#1

Hello,

when using the IDE it is no problem to have a Java class and a Kotlin class in the same package and have both classes call each others methods. So far so good, but what happens when I use Maven to build my deployment jar? Is there a way to get this to build when using Maven as well? That would be really nice.

Regaeds, Oliver


#2

It's no problem, right? If you start out with a Maven project, then convert a file to Kotlin or add a Kotlin file, IntelliJ will add the necessary magic to your POM for you. The only oddity is that kotlin code ends up in the java directory, instead of src/main/kotlin, but I guess it's no problem in reality.