IntelliJ 13 and Gradle: cannot find symbol / package does not exist and unable to run ScalaTest

I (successfully?) imported a multimodule Gradle project in IntelliJ. One of the module is a Scala module and the remaining ones are Java modules. One of the java modules produces a WAR artifact. IntelliJ seems to recognize all the modules and even the WAR artifact, which is a good thing. It correctly recognizes the Scala module as well. However, the project is unusable.

When trying to build the project, the dependencies aren't getting resolved for some reason and I get messages like:

  java: .../MyClass.java:3: cannot find symbol
  symbol  : class SomeClass
  location: package some.package

Note that class MyClass is in module x which depends on y and class some.package.SomeClass is in module y. I can navigate the code (using Ctrl + click) correctly but the file has a 'J' little icon indicating that it's not getting correctly parsed as source file. It's worth noting that this is a legacy project and the source/resource folders all have custom locations.

Similarly I get a "package does not exist" message if the whole package can't be found.

Moreover, the ScalaTest files can't be run correctly as I get the following:

  Unable to load a Suite class. This could be due to an error in your runpath. Missing class: com.my.package.SomeSpec

Are these known issues? Is there a work around?

Given the shortcomings of JetGradle in the previous version I was really hoping that version 13 would work better. It looks like it's still falling short.

Thanks!

1 comment
Comment actions Permalink

Looks like since my java modules have non-standard source folders, IntelliJ is not able to pick that up from the Gradle build files. This is a terrible shortcoming. No idea what's going on with the scala module (which has standard source/test folders).

0

Please sign in to leave a comment.