IntelliJ does not compile source files, unless I put "Build Project" in Before Launch steps

189 views Asked by At

I have a maven project for Cucumber in Java, where I am mixing Java+Kotlin. The maven build works fine and compiles files as I change them. But when I run a test (*.feature file) from IntelliJ, the files are not compiled.

As per the default 'Run Configuration', the step to run 'Before Launch' of test is 'Build'. If I change the configuration to run 'Build Project' instead, the files are getting compiled. But it should work even with default 'Build' step. It won't be feasible to ask the whole team to change their default settings only to use Kotlin in a working Java project.

I am using Kotlin v1.7.21. I tried deleting all the .idea/.., *.iml files and reimporting the project multiple times without any luck.

Github project to reproduce


Kotlin compiler settings



I have tried below Q&A, but none of them worked
Changing the order of maven plugins execution
Intellij Idea won't compile kotlin but maven does

0

There are 0 answers