title: IntelliJ + SBT plugin + multiproject setup = Unresolved dependency?
body: <p>I created a new project with the following structure (obfuscated names :):</p>
  
  <pre><code>Parent
  |-- Child A
  |-- Child B
  </code></pre>
  
  <p>The light build definition in <code>Parent/build.sbt</code> is as follows:</p>
  
  <pre><code>name := "Parent"
  
  scalaVersion := "2.9.1"
  
  version := "1.0.0-SNAPSHOT"
  </code></pre>
  
  <p>The full definition in <code>Parent/project/Build.scala</code> is as follows:</p>
  
  <pre><code>import sbt._
  import Keys._
  
  object MyBuild extends Build {
      lazy val root = Project(id = "Parent",
                              base = file(".")) aggregate(projectA, projectB)
  
      lazy val projectA = Project(id = "Project A",
                             base = file("projectA"))
  
      lazy val projectB = Project(id = "Project B",
                             base = file("projectB"))
  }
  </code></pre>
  
  <p>In <code>~/.sbt/plugins/build.sbt</code>, I have this:</p>
  
  <pre><code>resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"
  
  addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "0.11.0")
  </code></pre>
  
  <p>If I run <code>sbt gen-idea</code> in the folder <code>Parent</code>, all dependencies are downloaded properly and the project definitions are created correctly for <code>Parent</code>. However, sbt also tries to run the command in the subprojects, <code>projectA</code> and <code>projectB</code>. This fails with the following:</p>
  
  <pre><code>[warn]  module not found: com.github.mpeltonen#sbt-idea;0.11.0
  [warn] ==== local: tried
  [warn]   /home/me/.ivy2/local/com.github.mpeltonen/sbt-idea/scala_2.9.1/sbt_0.11.1/0.11.0/ivys/ivy.xml
  [warn] ==== Maven2 Local: tried
  [warn]   file:/home/me/.m2/repository/com/github/mpeltonen/sbt-idea_2.9.1_0.11.1/0.11.0/sbt-idea-0.11.0.pom
  [warn] ==== typesafe-ivy-releases: tried
  [warn]   http://repo.typesafe.com/typesafe/ivy-releases/com.github.mpeltonen/sbt-idea/0.11.0/ivys/ivy.xml
  [warn] ==== public: tried
  [warn]   http://repo1.maven.org/maven2/com/github/mpeltonen/sbt-idea_2.9.1_0.11.1/0.11.0/sbt-idea-0.11.0.pom
  [warn] ==== Scala-Tools Maven2 Repository: tried
  [warn]   http://scala-tools.org/repo-releases/com/github/mpeltonen/sbt-idea_2.9.1_0.11.1/0.11.0/sbt-idea-0.11.0.pom
  [warn] ==== Scala-Tools Maven2 Snapshots Repository: tried
  [warn]   http://scala-tools.org/repo-snapshots/com/github/mpeltonen/sbt-idea_2.9.1_0.11.1/0.11.0/sbt-idea-0.11.0.pom
  [info] Resolving commons-io#commons-io;2.0.1 ...
  [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
  [warn]  ::          UNRESOLVED DEPENDENCIES         ::
  [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
  [warn]  :: com.github.mpeltonen#sbt-idea;0.11.0: not found
  [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
  [warn] 
  [warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
  [warn]      com.github.mpeltonen:sbt-idea:0.11.0 (sbtVersion=0.11.1, scalaVersion=2.9.1)
  [warn] 
  [error] {file:/opt/workspace/Parent/}ProjectA/*:update-sbt-classifiers: sbt.ResolveException: unresolved dependency: com.github.mpeltonen#sbt-idea;0.11.0: not found
  [info] Created /opt/workspace/Parent/.idea_modules/project.iml
  </code></pre>
  
  <p>I get the same result if I move <code>~/.sbt/plugins/build.sbt</code> to <code>Parent/project/build.sbt</code>.</p>
  
  <p>How can I prevent the children of <code>Parent</code> to execute <code>gen-idea</code>?</p>