I have a multi-project gradle project (written in scala 2.11). Most projects depend on one or more of the other projects, for example:
Normally this would mean that all the classes in src/main/scala of sample-data-model are available on the classpath of sample-data-repository (both runtime and in tests).
However, IDEA's auto-completion and syntax checker seem to think that also the classes in src/test/scala of sample-data-model are available on the classpath of tests in sample-data-repository. For example, it will happily allow me to take some test class in sample-data-repository (e.g. PersonDmoRepositoryIT) and add a line that references a test class in sample-data-model (e.g. JsonModelSerializerIT). It autocompletes, there are no red lines, it compiles flawlessly, and IDEA will even run the test.
On the command line, however, gradle test will fail, complaining that:
... PersonDmoRepositoryIT.scala:16: error: not found: type JsonModelSerializerIT
val x: JsonModelSerializerIT = new JsonModelSerializerIT
I would say that command line gradle is correct. The test classes of one module shouldn't be on the classpath of another module, not at runtime, not even during a unit test.
I find it hard to say why this is going wrong. Does it have something to do with configuration of the gradle plugin, scala compile server, ...?
I'm using IDEA 14.1.4 community edition, fresh out of the box (no configuration changes from the default, except a different font). I added the scala & gradle plugins after importing the project (as prompted by IDEA). The IDEA project was generated by gradle using gradle idea.
P.S. The project I'm working on is on https://github.com/jasperavisser/octowight-example