title: Why does my Kotlin compilation fail using Kotlin-Maven-Plugin?
body: <p>While trying to compile a Java/Kotlin hybrid project, I received the following error:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.1.3-2:compile (compile) on project tablesaw-core: Compilation failure
  [ERROR] java.lang.ArrayIndexOutOfBoundsException: 32
  [ERROR] at org.jetbrains.org.objectweb.asm.ClassReader.readUTF8(ClassReader.java:2529)
  [ERROR] at org.jetbrains.org.objectweb.asm.ClassReader.readModule(ClassReader.java:777)
  [ERROR] at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:646)
  [ERROR] at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:507)
  [ERROR] at org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleInfo$Companion.read(JavaModuleInfo.kt:51)
  [ERROR] at org.jetbrains.kotlin.cli.jvm.modules.CliJavaModuleFinder.computeAllSystemModules$kotlin_compiler(CliJavaModuleFinder.kt:28)
  [ERROR] at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.computeRootModules(KotlinCoreEnvironment.kt:298)
  [ERROR] at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.addModularRoots(KotlinCoreEnvironment.kt:277)
  [ERROR] at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.convertClasspathRoots(KotlinCoreEnvironment.kt:269)
  [ERROR] at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.&lt;init&gt;(KotlinCoreEnvironment.kt:197)
  [ERROR] at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.&lt;init&gt;(KotlinCoreEnvironment.kt:109)
  [ERROR] at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:423)
  [ERROR] at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:240)
  [ERROR] at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createEnvironmentWithScriptingSupport(K2JVMCompiler.kt:230)
  [ERROR] at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:189)
  [ERROR] at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:55)
  [ERROR] at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:182)
  [ERROR] at org.jetbrains.kotlin.maven.KotlinCompileMojoBase.execCompiler(KotlinCompileMojoBase.java:236)
  [ERROR] at org.jetbrains.kotlin.maven.K2JVMCompileMojo.execCompiler(K2JVMCompileMojo.java:184)
  [ERROR] at org.jetbrains.kotlin.maven.K2JVMCompileMojo.execCompiler(K2JVMCompileMojo.java:43)
  [ERROR] at org.jetbrains.kotlin.maven.KotlinCompileMojoBase.execute(KotlinCompileMojoBase.java:219)
  [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
  [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
  [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
  [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
  [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
  [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
  [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
  [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
  [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
  [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
  [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
  [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
  [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
  [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
  [ERROR] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
  [ERROR] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
  [ERROR] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
  [ERROR] at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:533)
  [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
  [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
  [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
  [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  </code></pre>
  
  <p>I am using Maven 3.3.9 with Kotlin 1.1.3-2, and Java 1.8</p>
  
  <p>In googling for similar problems I saw similar results from other code using ClassReader. Those issues were attributed to a version mismatch, but the examples were not using Kotlin and I think my versions are ok.</p>
  
  <p>My pom file is: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;tech.tablesaw&lt;/groupId&gt;
      &lt;artifactId&gt;tablesaw-parent&lt;/artifactId&gt;
      &lt;version&gt;0.8-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;artifactId&gt;tablesaw-core&lt;/artifactId&gt;
  &lt;version&gt;0.8-SNAPSHOT&lt;/version&gt;
  
  &lt;packaging&gt;jar&lt;/packaging&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.0.2&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                     &lt;goals&gt;
                         &lt;goal&gt;test-jar&lt;/goal&gt;
                     &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-gpg-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.sonatype.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;nexus-staging-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.jetbrains.kotlin&lt;/groupId&gt;
              &lt;artifactId&gt;kotlin-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.jetbrains.kotlin&lt;/groupId&gt;
          &lt;artifactId&gt;kotlin-stdlib-jre8&lt;/artifactId&gt;
          &lt;version&gt;${kotlin.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.jetbrains.kotlin&lt;/groupId&gt;
          &lt;artifactId&gt;kotlin-test-junit&lt;/artifactId&gt;
          &lt;version&gt;${kotlin.version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p></p>