1
votes

I have my project (just for experiments with sbt) which is based on sbt 0.10. And another one which I want to use as a dependency. It is sbt 0.7 based.

Currently I'm trying to include the second it into my project project using uri reference. But the build is failing, probably because of incompatible versions of sbt in these projects. The error message is:

[info] Compiling 1 Scala source to /home/zan/.sbt/staging/113d72bca54918c1f033/project/plugins/target/scala-2.8.1.final/classes...
[error] /home/zan/.sbt/staging/113d72bca54918c1f033/project/plugins/Plugins.scala:1: not found: value sbt
[error] import sbt._
[error]        ^
[error] /home/zan/.sbt/staging/113d72bca54918c1f033/project/plugins/Plugins.scala:3: too many arguments for constructor Object: ()java.lang.Object
[error] class Plugins(info: ProjectInfo) extends PluginDefinition(info)  {
[error]              ^

... and so on.

Can I somehow reference the second project so it will be possible to bild and/or run my project with just one command?

1

1 Answers

3
votes

SBT cross-project references are only supported if both projects use SBT 0.10. But you can use publish and artifact and depend on this from the downstream project through Ivy.

Issue the publish-local command in the first project to package the code in a JAR and write it to ~/.ivy2/local/org.abc.def/....

In the SBT 0.10 project, add this setting:

libraryDependencies += "org.abc" %% "def" % "0.1"