Hi
So this is my project structure:
My project is a maven project, with most of the code being in java, and some of it in scala. The thing to note here is that my source directory for both is same, i.e. src/main/java. I don't want to create src/main/scala since then classes in the same package would reside in different directories and I don't want that.
For building via maven, I use scala-maven-plugin like below:
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.4.4</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile-first</id>
<phase>process-test-resources</phase>
<goals>
<goal>add-source</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
</configuration>
</plugin>
For IDE, I use IntelliJ and that has a very good scala plugin, which handles everything smoothly.
My colleagues use Eclipse and for them, they have to install Scala IDE for eclipse to be able to handle scala code.
Now the problem is that because my scala code resides inside src/main/java, it's not "detected" and java code depending on those shows the error "symbol so and so could not be resolved". I tried moving scala files to src/main/scala and it seems to pick them up fine after that. So I do have a workaround, but as I mentioned earlier, I don't want classes of same package residing in different directories.
So essentially my question is: Is there a way for Scala IDE to pick up scala code from src/main/java? Any pointers are appreciated.