well, i needed to convert a project made with eclipse to an SBT project.
still, when i compile, some unresolved dependencies causes compilation errors.
> compile
[info] Compiling 9 Scala sources to /home/giladhoch/workspace/clever_dropbox/clever_dropbox_manager/target/scala-2.9.0.1/classes...
[error] /home/giladhoch/workspace/clever_dropbox/clever_dropbox_manager/src/main/scala/filesTagSystem/DynamicClassLoader.scala:7: not found: object labels
[error] import labels.FileLabeler
[error] ^
[error] /home/giladhoch/workspace/clever_dropbox/clever_dropbox_manager/src/main/scala/filesTagSystem/DynamicClassLoader.scala:96: value labelFile is not a member of type parameter A
[error] fileLabelers.foreach{ f=> f.labelFile(file).foreach{ s=> tagsList+=s}}
[error] ^
[error] /home/giladhoch/workspace/clever_dropbox/clever_dropbox_manager/src/main/scala/watchDirectory/ServiceManager.scala:9: object StandardWatchEventKind is not a member of package java.nio.file
[error] import java.nio.file.StandardWatchEventKind._
[error] ^
[error] /home/giladhoch/workspace/clever_dropbox/clever_dropbox_manager/src/main/scala/main/clientManager.scala:24: overloaded method constructor Thread with alternatives:
[error] (java.lang.String)java.lang.Thread <and>
[error] (java.lang.Runnable)java.lang.Thread
[error] cannot be applied to (watchDirectory.ServiceManager)
[error] val serviceThread = new Thread(service)
[error] ^
[error] four errors found
[error] {file:/home/giladhoch/workspace/clever_dropbox/clever_dropbox_manager/}default-55f3d0/compile: Compilation failed
[error] Total time: 3 s, completed Sep 15, 2011 4:42:32 AM
as you can see, the errors are caused by two unresolved imports.
first one for import labels.FileLabeler and the second one for import java.nio.file.StandardWatchEventKind._
well, i have no idea why the java.nio import does’nt work. JAVA_HOME is defined to java7 folder, so should’nt SBT supposed to know to look there? and for the other import, well, it’s a local precompiled class file. i tried to add in build.sbt the following:
resolvers += Resolver.file("local-lib", file("/home/*path-to-project*/src/main/scala/tagsPluginsDir/")) transactional()
but it didn’t help much…
so how can this be solved?
thanks,
Gilad.
problem has been resolved:
for the outer source files, i opened a new sbt project and used publish-local, so the jars end up in the .ivy2 folder, so sbt now know where to get the dependencies from.
as for the java.nio.file.StandardWatchEventKind import, turns out it just had a missing trailing s, and it should be: java.nio.file.StandardWatchEventKind*s*