Reputation: 6422
I am starting a Scala project and I'm using SBT and Intellij 13 as my IDE.
I have the following build.sbt file, but I can't seem to get the dependencies in the SBT "libraryDependencies" section to show up in "External Libraries" after running "sbt update".
The following is my build.sbt:
name := "myapp-scala"
version := "1.0"
scalaVersion := "2.10.3"
resolvers += "spray repo" at "http://repo.spray.io"
resolvers += "spray nightlies" at "http://nightlies.spray.io"
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.2.0",
"com.typesafe.akka" %% "akka-slf4j" % "2.2.0",
"ch.qos.logback" % "logback-classic" % "1.0.13",
"io.spray" % "spray-can" % "1.2-20130712",
"io.spray" % "spray-routing" % "1.2-20130712",
"io.spray" %% "spray-json" % "1.2.3",
"org.specs2" %% "specs2" % "1.14" % "test",
"io.spray" % "spray-testkit" % "1.2-20130712" % "test",
"com.typesafe.akka" %% "akka-testkit" % "2.2.0" % "test",
"com.novocode" % "junit-interface" % "0.7" % "test->default",
"org.scalautils" % "scalautils_2.10" % "2.0",
"org.scalatest" % "scalatest_2.10" % "2.0" % "test"
)
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-Xlint",
"-Ywarn-dead-code",
"-language:_",
"-target:jvm-1.7",
"-encoding", "UTF-8"
)
Can anyone point me in the right direction?
Upvotes: 12
Views: 12318
Reputation: 1273
Similar to what @samspired said
I just made the sbt.Project variable name exactly like the name of the project module name and it solved the problem.
go to File -> Project Structure -> Modules
and see what the module name is - (it doesn't have to be like the project directory name but if you didn't change it, it's probably it )
// this file is in the path of "../Somewhere_in_file_system/MyProjectName/build.sbt"
lazy val MyProjectName /*this is the module name*/ = (project in file("."))
.settings(
scalaVersion := "2.11.8",
name := "com-company-blabla-myproject" //..... and all the other sbt properties
)
Upvotes: 0
Reputation: 11
I had the same problem on IntelliJ CE 14.0.2 The project/app name under build.sbt and project/build.scala file need to be same. That helped fixing the issue for me.
Upvotes: 0
Reputation: 82470
The best way to start working with IDEA 13 and a sbt
project is this:
sbt
plugin installed
This should fix everything up for you, and you can run your commands via the sbt console:
Upvotes: 11
Reputation: 7466
To integrate Sbt with Intellij IDEA you need to use this plugin: https://github.com/mpeltonen/sbt-idea
It provides you with the Sbt task gen-idea
which will generate the files required to configure IDEA with your project.
Upvotes: 1