0

I have a project containing our Gatling performance tests. I've imported the Maven project into Scala IDE, and I can see that the project has a Scala nature.

However, when I look at the package tree in the package explorer (it's located in src/test/scala), I see the regular folder hierarchy instead of it being flattened by package:

package explorer

Furthermore, automatic imports, ctrl+click and basically every other IDE feature do not work.

What would I have to configure?

(I'm not that familiar with both Scala and Maven, so I'm not quite sure what other info is relevant here - do enlighten me if I missed anything.)

cchantep
  • 9,118
  • 3
  • 30
  • 41
Vincent
  • 4,876
  • 3
  • 44
  • 55
  • Right Click -> Build Path -> Use as Source Folder ? – insan-e Jun 22 '16 at 07:35
  • That's it! Thank you very much - I was hoping it would be such a small thing. If you post it as an answer I can expect it and you can indulge in some sweet, sweet karma :) – Vincent Jun 22 '16 at 07:40

1 Answers1

2

Right Click -> Build Path -> Use as Source Folder.

Any folder can become a source folder by adding it to the Java build path. Build path is basically "stuff" (jars, files and folders) that compiler will consider when compiling your source files.

insan-e
  • 3,883
  • 3
  • 18
  • 43
  • Awesome, thanks. To those with my low level of knowledge coming across this question later: I think adding the Scala nature to your project is required as well. `Right Click` the project folder -> `Configure` -> Add Scala Nature` in Eclipse 4.5.1. – Vincent Jun 22 '16 at 09:38
  • I rarely see someone using Maven with Scala, usually sbt is preferred(or TypeSafe activator, which "contains" sbt). It has [sbteclipse](https://github.com/typesafehub/sbteclipse) plugin so when you do `sbt eclipse` it generates Eclipse Scala project files for you. I'm not that familiar with Maven, but it seems that there exists a plugin for it also [here](http://docs.scala-lang.org/tutorials/scala-with-maven.html). – insan-e Jun 22 '16 at 09:45
  • Good addition. I haven't set up this project, but as the rest of the project (i.e. the thing that is being load tested) is in Java, I guess it makes sense for us to use Maven. – Vincent Jun 22 '16 at 11:09