title: Mixing Java and Kotlin with Maven, can't find symbol
body: <p>I'm trying to add some Kotlin classes into my existing Java project under Vaadin Framework (v 8.4.5).</p>
  
  <p>I've fully read the tutorial on <a href="https://kotlinlang.org/docs/tutorials/mixing-java-kotlin-intellij.html" rel="nofollow noreferrer">how to mixing java and Kotlin</a>, and I've successfully created a Kotlin class inside my existing Java Project.</p>
  
  <p>The new Kotlin class is inside my project (ofc I've cutted away all code for privacy)</p>
  
  <pre><code>package it.projectName.utils
  
  import it.projectName.otherClasses
  
  class SecurityUtils (user: User) {
      //various val and var, and of course the isCrypted calculated val
  
      init {
          if(!isCrypted){
              //encrypt user password
          }
      }
  }
  </code></pre>
  
  <p>Now I'm using this Kotlin class inside my Java class with </p>
  
  <pre><code>import it.projectName.utils.SecurityUtils;
  public class UserDao{
      //[... other code ...]
      SecurityUtils securityUtils = new SecurityUtils(user);
  }
  </code></pre>
  
  <p>Everything is fine, I don't get any compiler error.
  But when I try to run my project with maven with <code>jetty:run</code> , it throws an error:</p>
  
  <pre><code>[ERROR] COMPILATION ERROR : 
  [INFO] -------------------------------------------------------------
  [ERROR] /C:/pathToClass/UserDao.java:[9,36] cannot find symbol
    symbol:   class SecurityUtils
    location: package it.projectName.utils
  [INFO] 1 error
  [INFO] -------------------------------------------------------------
  </code></pre>
  
  <p>The line he's referring to is <code>import it.projectName.utils.SecurityUtils;</code></p>
  
  <p>I've checked my <code>pom.xml</code>, everything looks fine there aswell:</p>
  
  <pre><code>    &lt;properties&gt;
          &lt;kotlin.version&gt;1.2.61&lt;/kotlin.version&gt;
          &lt;kotlin.compiler.incremental&gt;true&lt;/kotlin.compiler.incremental&gt;
      &lt;/properties&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jetbrains.kotlin&lt;/groupId&gt;
          &lt;artifactId&gt;kotlin-stdlib-jdk8&lt;/artifactId&gt;
          &lt;version&gt;${kotlin.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.jetbrains.kotlin&lt;/groupId&gt;
          &lt;artifactId&gt;kotlin-test&lt;/artifactId&gt;
          &lt;version&gt;${kotlin.version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;plugin&gt;
              &lt;groupId&gt;org.jetbrains.kotlin&lt;/groupId&gt;
              &lt;artifactId&gt;kotlin-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${kotlin.version}&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;compile&lt;/id&gt;
                      &lt;phase&gt;compile&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;compile&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;sourceDirs&gt;
                              &lt;sourceDir&gt;src/main/java&lt;/sourceDir&gt;
                              &lt;sourceDir&gt;src/main/kotlin&lt;/sourceDir&gt;
                          &lt;/sourceDirs&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;id&gt;test-compile&lt;/id&gt;
                      &lt;phase&gt;test-compile&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;test-compile&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;sourceDirs&gt;
                              &lt;sourceDir&gt;src/main/java&lt;/sourceDir&gt;
                              &lt;sourceDir&gt;src/main/kotlin&lt;/sourceDir&gt;
                          &lt;/sourceDirs&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;jvmTarget&gt;1.8&lt;/jvmTarget&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>What I'm missing?
  Thanks</p>