I am dealing with multi-project builds. In project A I have a helper class that is used by test classes in the same project as well as test classes in another project B. All good. When I use the helper class from project A in a main source class in project C I get a compile error in IntelliJ. Gradle build works fine though - after adding the following to the build.gradle file of project C:
This can cause a lot of troubles - when deploying, in the Gradle build, in IDEs, etc. To give just one example, the new compiler in IDEA 12 no longer supports having a dependency from sources in module A on test sources in module B, and you’ll have to fall back to the old compiler. Rather than working around such problems, it’s better, and likely easier, to fix the root cause.