How to load resources in new MPP

I agree with you. I think it’s only this bug https://youtrack.jetbrains.com/issue/KT-24463

But it should be qualified as BUG and not problem, with a critical priority. Let me explain why.

When you create a multiplatform JS / JVM project using Intellij Idea

you get a Ktor project with a jvmMain/resources/logback.xml file.

image

Everything looks fine, and you can run the project directly from the main function.

The problem is that the file is not in the classpath.

It takes time to understand the problem and this is a terrible first experience for someone who is trying to run a multiplatform project.

This bug is specific to the new MPP plugin. The same project split into modules with the “old” multiplatform plugin does not have the problem. However, the old plugin is not mentioned anymore in Kotlin documentation. Maybe it should remain until all the major and critical issues of the new MPP plugin are resolved.

1 Like