How to create SBT project with IntelliJ Idea?

前端 未结 7 1673
故里飘歌
故里飘歌 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:21

    For sbt 0.7

    See the answer elsewhere on this page.

    For sbt 0.10

    Clone and build Ismael's sbt-idea:

    git clone https://github.com/ijuma/sbt-idea.git
    cd sbt-idea
    git checkout sbt-0.10
    ./sbt package
    

    Create an sbt plugin lib directory if you don't have one already

    mkdir -p  ~/.sbt/plugins/lib
    

    Copy the jar built in step one into here

    cp sbt-idea/target/scala-2.8.1.final/*.jar ~/.sbt/plugins/lib
    

    Restart or reload sbt, then you can run gen-idea (or gen-idea with-classifiers if you want sources and javadoc in intelliJ too)

    Source: Tackers' suggestion on the message group.

    In IntelliJ IDEA 13.x itself

    You can open an SBT-based project in IDEA nowadays. It will create the necessary project and modules, and keep your dependencies up-to-date whenever you make changes to the build scripts.

提交回复
热议问题