1

Im using IntelliJ Idea IDE for working on a scalatra project i created using giter8.I use sbt to run the project.When i open the project in IntelliJ , i get the following errors in MyScalatraServlet.scala:

Cannot resolve symbol scalate
Cannot resolve symbol ScalatraServlet
Cannot resolve symbol ScalateSupport

The code for MyScalatraServlet.scala is as follows:

import org.scalatra._
import java.net.URL
import scalate.ScalateSupport

class MyScalatraServlet extends ScalatraServlet with ScalateSupport {

  get("/") {
    <html>
      <body>
        <h1>Hello, world!</h1>
        Say <a href="hello-scalate">hello to Scalate</a>.
      </body>
    </html>
  }

  notFound {
    // Try to render a ScalateTemplate if no route matched
    findTemplate(requestPath) map { path =>
      contentType = "text/html"
      layoutTemplate(path)
    } orElse serveStaticResource() getOrElse resourceNotFound() 
  }
}

Any way i can resolve these dependencies ?. If not any way to hide these cannot resolve errors in IntelliJ ?

Please Help Thank You

  • Are the errors only in the presentation compiler, or in the actual building? If the latter, are you building with sbt or IDEA? Probably you are missing the dependency entries in your project. Have you tried creating the IDEA project with the sbt-idea plugin (https://github.com/mpeltonen/sbt-idea). I highly recommend it, as it takes care of adding libraries and dependencies, frees you from all that trouble. – 0__ Dec 06 '11 at 13:49

1 Answers1

2

You need to use the sbt-idea sbt pluging to generate the dependencies in a way Intellij can read them (xml files with the dependecies)

Arnon Rotem-Gal-Oz
  • 25,469
  • 3
  • 45
  • 68