6

I have downloaded and installed sbt and plugin for gen-idea. But the built projects can not be run on idea. Also the "project" folder is not generated when I run gen-idea. Can someone please tell me how I should install sbt and sbt-idea plugin and configure it, as I think the problem here is configuring.

bula
  • 8,719
  • 5
  • 27
  • 44
  • 1
    This question appears to be off-topic because it is about proper installation and configuration of the plugin. A better answer would be found within the plugin documentation. – pagoda_5b Jan 10 '14 at 13:35

1 Answers1

8

In all sbt projects you have a project folder (in the root of your project directory). You need to create there a file called - plugins.sbt and place there:

resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0-SNAPSHOT")

Notice that i have a blank line between. Then, if you have an opened sbt session call reload command, you can call gen-idea to generate idea files, also i recomend to add sbt-classifiers to download sources.

Otherwise you can make this plugin visible globally to all your sbt project, by placing the same two line in the ~/.sbt/0.13/plugins/build.sbt file.

When you have generated this project, in IDEA choose Open Project and choose your newly generated project. This should work, if not, provide some additional info.

Feyyaz
  • 3,147
  • 4
  • 35
  • 50
4lex1v
  • 21,367
  • 6
  • 52
  • 86
  • thanks. I did same. but after opening it in idea I tried to run it. It says Exception in thread "main" java.lang.RuntimeException: Wrong arguments: [scala.tools.nsc.CompileClient] at org.jetbrains.plugins.scala.compiler.rt.ClassRunner.main(ClassRunner.java:30) – bula Dec 09 '13 at 07:05
  • 1
    When you do this in IDEA, for example with sbt plugin, then IDEA should pop-up with a `reload project` window. – 4lex1v Dec 09 '13 at 07:06
  • 1
    Is `gen-idea` still needed when we are using idea sbt and Scala plugins? –  Jun 14 '14 at 00:36
  • 2
    It has to be `1.6.0` only now. `1.6.0-SNAPSHOT` is a 404 – Niks Jun 21 '16 at 11:06