How to create SBT project with IntelliJ Idea?

前端 未结 7 1592
故里飘歌
故里飘歌 2020-11-29 14:48

I just got started with Scala/LiftWeb/Sbt developing, and I\'d like to import a Sbt project in IntelliJ Idea. Actually, I managed to import my project in two different ways:

相关标签:
7条回答
  • 2020-11-29 15:29

    Tempus fugit and IntelliJ IDEA has become so much better these days. It's 2015 after all, isn't it?

    Having said that, the latest version of IntelliJ IDEA 14.0.2 supports sbt projects out of the box with the Scala plugin. Just install the plugin and you should be able to open up Scala/sbt projects without much troubles.

    Scala plugin under Plugins in Preferences

    I'm using the Early Access version of the plugin which is 1.2.67.6.EAP as of the time of the writing.

    With the plugin just point at a sbt project and IDEA is going to offer you a wizard to open that kind of project.

    Import sbt project

    About sbt-idea in sbt 0.12.4

    For sbt 0.12.4 the system-wide plugin configuration file - ~/.sbt/plugins/build.sbt or PROJECT_DIR/project/plugins.sbt - should have the following lines:

    resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
    
    addSbtPlugin(dependency="com.github.mpeltonen" % "sbt-idea" % "1.5.0-SNAPSHOT")
    

    Run sbt gen-idea to generate IDEA project files.

    Read the sbt-idea plugin website for more up-to-date information. You may also find my blog entry Importing sbt-based project to IntelliJ IDEA 13 (with sbt-idea, Scala 2.11 and sbt 0.12) useful.

    0 讨论(0)
提交回复
热议问题