Idea keeps switching compile target from 1.8 to 1.6 for Kotlin

So after a lot of try & error attempts I found out that Idea picks version 1.6 because this is Kotlin's default JVM target version and I haven't set that 1.8 version anywhere in pom.xml or build.gradle. If this version isn't defined there, Idea apparently tends to ignore project settings and stick to defaults.

This means the solution is to set the version in the kotlin plugin manually, but first make sure you have done everything listed in the accepted answer to the question dealing with the same problem but in Java.

Now, assuming you are using Gradle (I stayed with it after the migration) you should just follow the instructions to include kotlin plugin in your build.gradle as written in kotlin's docu on how to use it with Gradle. This isn't enough though, so you have to scroll down in that document and find kotlin compile options, jvmTarget in particular. There you will find out that the version 1.6 is indeed default and you can proceed with configuring your compile task in build.gradle:

compileKotlin { kotlinOptions.jvmTarget = 1.8 }

Voila, now each reimport sticks to 1.8. If you use Maven, there is also a plugin you can use (just google it) and I am sure there will be the same jvmTarget setting at your disposal, though I haven't tried that.