I’ve created a Vaadin project using maven, and installed the war in my local maven repository.
This project defines a public class, com.whatever.User.
Then, I created an sbt project wherein I’d like to add a depenecy on the Vaadin project – in order to test it’s logic. In the build.sbt file of my sbt project I’ve added:
resolvers += "Local Maven Repository" at "file://"+Path.userHome+"/.m2/repository"
libraryDependencies ++= Seq(
"com.whatever" % "something" % "1.0"
)
After reloading the sbt project I tried using the User object from inside the sbt project. But I’m getting this error:
> test
[info] Compiling 1 Scala source to /Users/me/projects/something-test/target/scala-2.9.1/classes...
[error] /Users/me/projects/something-test/src/main/scala/TryingUser.scala:1: object whatever is not a member of package com
[error] import com.whatever.User
[error] ^
[error] one error found
[error] {file:/Users/me/projects/something-test/}default-1bc94a/compile:compile: Compilation failed
[error] Total time: 3 s, completed 2012-apr-25 13:44:56
what am I missing? Why isn’t sbt adding this dependency?
I can’t see sbt, or indeed any other build tool, being able to use war files as dependencies. Think about what the classpath passed to
javacorjavawould look like. The compiler will presumably just see it as a standard zip file and won’t be aware that the actual classes are inWEB-INF/classes.I think you’d need to package the classes as a jar file and use that as a dependency.