13.3.4 Kotlin and Retaining Parameter Names

Like with Java, the parameter name data for method parameters is not retained at compile time when using Kotlin. This can be a problem for Micronaut if you do not define parameter names explicitly and depend on an external JAR that is already compiled.

To enable the retention of parameter name data with Kotlin you should set the javaParameters option to true in your build.gradle:

build.gradle

  1. compileTestKotlin {
  2. kotlinOptions {
  3. jvmTarget = '1.8'
  4. javaParameters = true
  5. }
  6. }