0

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

vikrant21st
  • 93
  • 1
  • 7
  • Can you attach a link to your project? – vanyochek Dec 08 '22 at 11:42
  • Attached @vanyochek. Do you see what could be the issue? – vikrant21st Dec 09 '22 at 14:56
  • 1
    This feature isn't implemented yet — see https://youtrack.jetbrains.com/issue/KTIJ-12004/Please-make-it-possible-to-run-Cucumber-scenario-from-.feature-in-kotlin-project. – vanyochek Dec 12 '22 at 08:00
  • It seems like a **bug** rather than a missing feature. The sources under *test/* path are not "built" by IntelliJ *Build* when we add Kotlin support, but *main/* sources are built. Cucumber test is run as if it is not a test. *Cucumber for Java* (or maybe *Kotlin IDE*) plugin needs to be "adjusted" to fix it – vikrant21st Dec 13 '22 at 16:44

0 Answers0