sbt-eclipse
sbt-eclipse copied to clipboard
java.lang.IllegalStateException: Undefined setting 'eclipseSkipProject' (for RootProject)
I have been struggling with this bug for many hours. After migrating from Eclipse 2.3.0 to 4.0.0 (to use Play 2.4 instead of 2.3), I figured out that using RootProject prevent the eclipse plugin to work, although I explicitely asked him to discard the creation of the eclipse project for the rootProject. Can you please help me for that?
Setup
-
build.sbt
lazy val server = (project in file("server"))
.settings(scalaVersion := "2.11.7")
.dependsOn(leonProject)
lazy val leonProject = RootProject(uri("https://github.com/epfl-lara/leon.git#5bf8a57cc03ae5ccbd890e3f4f0121a6f9dd1bb2"))
EclipseKeys.skipProject in leonProject := true
EclipseKeys.preTasks := Seq(compile in Compile)
-
project/
-
plugins.sbt
-
resolvers += "Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases/"
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
-
build.properties
sbt.version=0.13.9
Then ,run
sbt eclipse
Expected
> eclipse
[info] About to create Eclipse project files for your project(s).
[info] Updating {file:/C:/Users/..../}server...
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] Successfully created Eclipse project files for project(s):
[info] server
Actual
> eclipse
[info] About to create Eclipse project files for your project(s).
java.lang.IllegalStateException: Undefined setting 'eclipseSkipProject in Scope(Select(ProjectRef(https://github.com/epfl-lara/leon.git#5bf8a57cc03ae5ccbd890e3f4f0121a6f9dd1bb2,root)),This,This,This)'!
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$setting$1.apply(Eclipse.scala:682)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$setting$1.apply(Eclipse.scala:682)
at scala.Option.getOrElse(Option.scala:120)
at com.typesafe.sbteclipse.core.Eclipse$.setting(Eclipse.scala:681)
at com.typesafe.sbteclipse.core.Eclipse$.skip(Eclipse.scala:601)
at com.typesafe.sbteclipse.core.Eclipse$.skip(Eclipse.scala:184)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$6$$anonfun$apply$3.apply(Eclipse.scala:122)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$6$$anonfun$apply$3.apply(Eclipse.scala:122)
at scala.Option$WithFilter.map(Option.scala:206)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$6.apply(Eclipse.scala:122)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$6.apply(Eclipse.scala:121)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
at com.typesafe.sbteclipse.core.Eclipse$.handleProjects(Eclipse.scala:121)
at com.typesafe.sbteclipse.core.Eclipse$.action(Eclipse.scala:105)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$eclipseCommand$2.apply(Eclipse.scala:86)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$eclipseCommand$2.apply(Eclipse.scala:86)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:58)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:58)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:60)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:60)
at sbt.Command$.process(Command.scala:92)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
at sbt.State$$anon$1.process(State.scala:184)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.MainLoop$.next(MainLoop.scala:98)
at sbt.MainLoop$.run(MainLoop.scala:91)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:70)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:65)
at sbt.Using.apply(Using.scala:24)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:65)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:48)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:32)
at sbt.MainLoop$.runLogged(MainLoop.scala:24)
at sbt.StandardMain$.runManaged(Main.scala:53)
at sbt.xMain.run(Main.scala:28)
at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:57)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:77)
at xsbt.boot.Launch$.run(Launch.scala:57)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45)
at xsbt.boot.Launch$.launch(Launch.scala:65)
at xsbt.boot.Launch$.apply(Launch.scala:16)
at xsbt.boot.Boot$.runImpl(Boot.scala:32)
at xsbt.boot.Boot$.main(Boot.scala:21)
at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.IllegalStateException: Undefined setting 'eclipseSkipProject in Scope(Select(ProjectRef(https://github.com/epfl-lara/leon.git#5bf8a57cc03ae5ccbd890e3f4f0121a6f9dd1bb2,root)),This,This,This)'!
[error] Use 'last' for the full log.
It looks like the problem comes from
EclipseKeys.skipProject in leonProject := true
being ignored. It tries to apply the eclipse plug-in recursively to sub-projects, which should not happen. If your provide me guidelines on how to fix it, I may submit it myself if needed.
I had the same problem. I had to add the sbteclipse
plugin to every /project/plugins.sbt
file in the set of projects to make the plugin work against a single project in a multi-project layout that uses RootProject
.
I believe the eclipse plug-in should be recursively applied, but that that isn't happening properly. I can set skipProject, but then am unable to build in eclipse, since the appropriate dependencies aren't being made available.