Reputation: 30145
Why version of SBT is playing role in name of fully qualified dependency ?
I thought it only depends on version of Scala.
Here is example.
build.sbt
has scalaVersion
set to 2.10.2
build.properties
has sbt.version
set to 0.12.1
plugins.sbt
has plugin dependency "com.github.siasia" %% "xsbt-web-plugin" % "0.12.0-0.2.11.1"
If I build it I see following in the log:
[info] Resolving com.github.siasia#xsbt-web-plugin_2.9.2;0.12.0-0.2.11.1 ...
But if I change sbt.version
set to 0.13.0-RC5
SBT fails to find this plugin and says in the log
[info] Resolving com.github.siasia#xsbt-web-plugin_2.10;0.12.0-0.2.11.1 ...
Why did it change scala version if it remains 2.10.2 in my config ? How to fix it ?
Upvotes: 0
Views: 204
Reputation: 1097
sbt projects are recursive, so each layer has its own settings(including scala version and classpath) (see http://www.scala-sbt.org/0.13.0/docs/Getting-Started/Full-Def.html )
sbt plugins are just regular libraries which depend on sbt, hence the plugins need to be cross-built across sbt versions (and each sbt version may require different scala version)
addSbtPlugin function takes care of that and resolves an appropriate artifact for current sbt and scala
siasia#xsbt-web-plugin is not really maintained anymore and it does not have versions for sbt 0.13, use https://github.com/JamesEarlDouglas/xsbt-web-plugin as a replacement
Upvotes: 4