Reputation: 478
I'm developing a SBT compiler plugin with Scala 2.9.2 and SBT 0.12.0.
My project uses the following build.sbt
:
name := "myplugin"
version := "0.1-SNAPSHOT"
scalaVersion := "2.9.2"
organization := "com.my.org"
sbtVersion := "0.12.0"
libraryDependencies += "org.scala-lang" % "scala-compiler" % "2.9.2"
After writing the plugin I'm publishing it to my local Ivy repository using publish-local
that publishes to ~\.ivy2\local\com.my.org\myplugin\0.1-SNAPSHOT
.
To test the plugin, I've created a simple "Hello-World" project and added the following project/build.sbt
file:
addSbtPlugin("com.my.org" %% "myplugin" % "0.1-SNAPSHOT")
When trying to load the project using sbt
I get an Unresolved Dependency
error for that plugin. I noticed that sbt
looks for the plugin in ~\.ivy2\local\com.my.org\myplugin\scala_2.9.2\sbt_0.12\0.1-SNAPSHOT
.
My question is how do I correct the configuration to include the Scala and SBT versions? Or, alternately, how do I resolve the plugin resolution to look in the right place?
Upvotes: 6
Views: 4617
Reputation:
I'd say all you're missing is the setting sbtPlugin := true
in your plug-in's build.sbt
. This should make your plug-in publish correctly.
Upvotes: 10