mpeltonen / sbt-idea

A simple-build-tool (sbt) plugin/processor for creating IntelliJ IDEA project files
Other
1.07k stars 153 forks source link

Cannot create IDEA files because of "Missing idea-sources-classifiers" error #256

Open unoexperto opened 11 years ago

unoexperto commented 11 years ago

Hey guys,

I'm having trouble generating IDEA project files for SBT script with dependencies. I'm using SBT .012.4.

I get error

[info] Loading project definition from C:\work\test_projects\scala_console\project
[info] Compiling 1 Scala source to C:\work\test_projects\scala_console\project\target\scala-2.9.2\sbt-0.12\classes...
[info] Set current project to root (in build file:/C:/work/test_projects/scala_console/)
[info] Creating IDEA module for project 'root' ...
[info] Resolving default#default-d23ab3_2.9.2;0.1-SNAPSHOT ...
  [info] Resolving org.scala-lang#scala-library;2.9.2 ...
[info] Creating IDEA module for project 'default-d23ab3' ...
[error] Missing idea-sources-classifiers
[error] java.lang.IllegalArgumentException
[error] Use 'last' for the full log.

My Build.scala is very simple:

import sbt._
import Keys._
import sbtassembly.Plugin.{MergeStrategy, AssemblyKeys, assemblySettings}
import AssemblyKeys._
import twirl.sbt.TwirlPlugin.Twirl
import spray.revolver.RevolverPlugin.Revolver
import com.github.siasia.WebPlugin.webSettings

object ProjectBuild extends Build {

  // main build file scope
  override def settings = super.settings ++ org.sbtidea.SbtIdeaPlugin.settings

  lazy val restFbProject = RootProject(uri("git://github.com/revetkn/restfb.git"))
  lazy val root = Project("root", file(".")) dependsOn restFbProject aggregate restFbProject
}

and finally my plugins.sbt is

addSbtPlugin("io.spray" % "sbt-revolver" % "0.7.1")

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

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.9.1")

addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.4")

addSbtPlugin("io.spray" % "sbt-twirl" % "0.6.1")

libraryDependencies += "com.github.siasia" %% "xsbt-web-plugin" % "0.12.0-0.2.11.1"

I tried running SBT with gen-idea no-classifiers no-sbt-classifiers - no difference.

Could you please tell me how to make it work ?

Thanks!

mpeltonen commented 11 years ago

Try if deleting the 'override def settings' line in your build file helps.

Also, you need the sbt-idea plugin definition in restFbProject's plugin.sbt (or make plugin declaration global).