title: Can't see scala classes from Main.java in Java-Scala maven project
body: <p>I'm following tutorial here:
  <a href="http://scala-tools.org/mvnsites/maven-scala-plugin/example_java.html" rel="nofollow">http://scala-tools.org/mvnsites/maven-scala-plugin/example_java.html</a> to have java with scala files in the same project</p>
  
  <p>however mvn compile fails with error: cannot find symbol<br>
  apparently complaining about places where the only scala class is being referenced.</p>
  
  <p>Here is my project structure:</p>
  
  <pre><code>.   
  ├── pom.xml
  ├── src 
  │   ├── main
  │   │   ├── java
  │   │   │   └── com 
  │   │   │       └── dummy
  │   │   │           └── foo 
  │   │   │               ├── Foo.java
  │   │   │               └── Main.java
  │   │   ├── resources
  │   │   └── scala
  │   │       └── com 
  │   │           └── dummy
  │   │               └── hello
  │   │                   └── Hello.scala
  │   └── test
  │       ├── java
  │       ├── resources
  │       └── scala
  ├── tree-pre-compile
  </code></pre>
  
  <p>And here it is again after running (the failing) mvn compile: (I can see that Hello.class is there under target/classes)</p>
  
  <pre><code>.
  ├── pom.xml
  ├── src
  │   ├── main
  │   │   ├── java
  │   │   │   └── com
  │   │   │       └── dummy
  │   │   │           └── foo
  │   │   │               ├── Foo.java
  │   │   │               └── Main.java
  │   │   ├── resources
  │   │   └── scala
  │   │       └── com
  │   │           └── dummy
  │   │               └── hello
  │   │                   └── Hello.scala
  │   └── test
  │       ├── java
  │       ├── resources
  │       └── scala
  ├── target
  │   ├── classes
  │   │   ├── Hello.class
  │   │   └── META-INF
  │   │       ├── MANIFEST.MF
  │   │       └── maven
  │   │           └── com.dummy.java-scala-poc
  │   │               └── mixed-java-scala-poc
  │   │                   ├── pom.properties
  │   │                   └── pom.xml
  │   ├── classes.timestamp
  │   └── test-classes
  └── tree-text
  </code></pre>
  
  <p>Main.java:</p>
  
  <pre><code>package com.dummy.foo;
  
  public class Main {
  
    public static void main(String[] args) {
      System.out.print("mixing java and scala");
      Foo foo = new Foo();
      foo.foo();
      new Hello().hello();
    }   
  
  } 
  </code></pre>
  
  <p>Foo.java:</p>
  
  <pre><code>package com.dummy.foo;
  
  public class Foo {
    public void foo() {
      System.out.print("mixing java and scala");
      new Hello().hello();
    } 
  }  
  </code></pre>
  
  <p>Hello.scala:</p>
  
  <pre><code>class Hello {
    def hello() { println("Hello (class)") }
  }
  
  object Hello {
    def hello() { println("Hello (object)") }
  }
  </code></pre>
  
  <p>pom.xml:</p>
  
  <pre><code>&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;groupId&gt;com.dummy.java-scala-poc&lt;/groupId&gt;
    &lt;artifactId&gt;mixed-java-scala-poc&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;mixed-java-scala-poc&lt;/name&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.scala-lang&lt;/groupId&gt;
              &lt;artifactId&gt;scala-library&lt;/artifactId&gt;
              &lt;version&gt;2.11.8&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;scala-tools.org&lt;/id&gt;
              &lt;name&gt;Scala-tools Maven2 Repository&lt;/name&gt;
              &lt;url&gt;http://scala-tools.org/repo-releases&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
      &lt;pluginRepositories&gt;
          &lt;pluginRepository&gt;
              &lt;id&gt;scala-tools.org&lt;/id&gt;
              &lt;name&gt;Scala-tools Maven2 Repository&lt;/name&gt;
              &lt;url&gt;http://scala-tools.org/repo-releases&lt;/url&gt;
          &lt;/pluginRepository&gt;
      &lt;/pluginRepositories&gt;
  
      &lt;build&gt;
          &lt;pluginManagement&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.scala-tools&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-scala-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.9.1&lt;/version&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;version&gt;2.0.2&lt;/version&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/pluginManagement&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.scala-tools&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-scala-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;scala-compile-first&lt;/id&gt;
                          &lt;phase&gt;process-resources&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;add-source&lt;/goal&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;                                    
                      &lt;execution&gt;
                          &lt;id&gt;scala-test-compile&lt;/id&gt;
                          &lt;phase&gt;process-test-resources&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;testCompile&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-compiler-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;compile&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>IDE being used is JBoss Developer Studio Version: 8.1.0.GA</p>
  
  <p>I can find other questions on SO with similar issues but to my best efforts nothing seemed to work.</p>
  
  <p>Here is the mvn compile output:</p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO]    
  [INFO] ------------------------------------------------------------------------
  [INFO] Building mixed-java-scala-poc 0.0.1-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ mixed-java-scala-poc --- 
  [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
  [INFO] Copying 0 resource
  [INFO] 
  [INFO] --- maven-scala-plugin:2.9.1:add-source (scala-compile-first) @ mixed-java-scala-poc --- 
  [INFO] Add Source directory: /home/hatieh/git/intelligence-ws/mixed-java-scala-poc/src/main/scala
  [INFO] Add Test Source directory: /home/hatieh/git/intelligence-ws/mixed-java-scala-poc/src/test/scala
  [INFO] 
  [INFO] --- maven-scala-plugin:2.9.1:compile (scala-compile-first) @ mixed-java-scala-poc --- 
  [ERROR] /home/hatieh/git/intelligence-ws/mixed-java-scala-poc/src/main/java
  [ERROR] /home/hatieh/git/intelligence-ws/mixed-java-scala-poc/src/main/scala
  [ERROR] /home/hatieh/git/intelligence-ws/mixed-java-scala-poc/src/test/scala
  [INFO] Compiling 3 source files to /home/hatieh/git/intelligence-ws/mixed-java-scala-poc/target/classes
  [INFO] 
  [INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ mixed-java-scala-poc --- 
  [INFO] Compiling 2 source files to /home/hatieh/git/intelligence-ws/mixed-java-scala-poc/target/classes
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 2.301s
  [INFO] Finished at: Thu Apr 28 15:25:55 EEST 2016
  [INFO] Final Memory: 12M/145M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project mixed-java-scala-poc: Compilation failure: Compilation failure:
  [ERROR] /home/hatieh/git/intelligence-ws/mixed-java-scala-poc/src/main/java/com/dummy/foo/Foo.java:[6,8] error: cannot find symbol
  [ERROR] 
  [ERROR] could not parse error message:   symbol:   class Hello
  [ERROR] location: class Foo 
  [ERROR] /home/hatieh/git/intelligence-ws/mixed-java-scala-poc/src/main/java/com/dummy/foo/Main.java:9: error: cannot find symbol
  [ERROR] new Hello().hello();
  [ERROR] ^
  [ERROR] -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
  </code></pre>