sbt / sbt-dependency-graph

sbt plugin to create a dependency graph for your project
Apache License 2.0
1.25k stars 113 forks source link

Plugin doesn't work on sbt 0.13.9 #148

Closed snthibaud closed 6 years ago

snthibaud commented 6 years ago

The plugin doesn't work for me on sbt 0.13.9 . I get the following stacktrace:

java.lang.NoSuchMethodError: sbt.Keys$.compatibilityWarningOptions()Lsbt/SettingKey;
        at sbt.dependencygraph.DependencyGraphSbtCompat$.updateTask(DependencyGraphSbtCompat.scala:63)
        at net.virtualvoid.sbt.graph.DependencyGraphSettings$.baseSettings(DependencyGraphSettings.scala:41)
        at net.virtualvoid.sbt.graph.DependencyGraphSettings$.graphSettings(DependencyGraphSettings.scala:36)
        at net.virtualvoid.sbt.graph.DependencyGraphPlugin$.projectSettings(DependencyGraphPlugin.scala:25)
        at sbt.Load$$anonfun$autoPluginSettings$1$1.apply(Load.scala:666)
        at sbt.Load$$anonfun$autoPluginSettings$1$1.apply(Load.scala:666)
        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.immutable.List.foreach(List.scala:318)
        at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
jrudolph commented 6 years ago

Seems 0.13.9 is not supported any more. Please try to use an older version of the plugin or update your build to a more recent sbt version.

0.8.2 should probably still work for 0.13.9.

Because we need to access some internals of sbt it's quite hard to support old versions (> 2 years old) in one code base reliably. I'll add a notice to the README, that 0.13.9 is not supported any more.

jrudolph commented 6 years ago

Hmm I guess it's still a nuisance as you might not be able to configure sbt-dependency-graph globally for sbt 0.13 because according to your stack trace it fails loading already while loading the project.

So maybe, let's keep this open. It can probably quite easily be fixed by copying enough of the missing setting key definition over to the plugin and using this statically:

https://github.com/sbt/sbt/blob/a5bd5643078cc97dce3e7121337a310dbee05e3c/main/src/main/scala/sbt/Keys.scala#L343

PR would be welcome if you are affected by this issue.

snthibaud commented 6 years ago

Thanks for looking into this!

jcranky commented 6 years ago

Just for the record, I also had a similar problem. I tried both sbt versions 0.13.16 and 0.13.17 - if I remove the plugin from my global plugins, the project loads fine.