2011-11-19 56 views
8

我刚刚升级到sbt 0.11.1,似乎没有取得 某些依赖关系。事情在升级之前工作正常。sbt 0.11.1不检索scalatra 2.1.0-SNAPSHOT依赖关系

我有这样的依赖性:

"org.scalatra" %% "scalatra" % "2.1.0-SNAPSHOT", 

当我compile

> update 
[success] Total time: 0 s, completed Nov 18, 2011 5:44:16 PM 
> compile 
[info] Compiling 29 Scala sources and 1 Java source to 
/home/yang/pod/sales/scala/target/scala-2.9.1/classes... 
[error] /home/yang/pod/sales/scala/src/main/scala/com/pod/Web.scala:125: 
not found: type ScalatraServlet 
[error] class PodWeb extends ScalatraServlet with ScalateSupport with 
FileUploadSupport { 
[error]     ^
[error] class file needed by ScalateSupport is missing. 
[error] reference type ScalatraKernel of package org.scalatra refers 
to nonexisting symbol. 
[error] two errors found 
[error] {file:/home/yang/pod/sales/scala/}pod/compile:compile: 
Compilation failed 
[error] Total time: 10 s, completed Nov 18, 2011 5:44:45 PM 

文件似乎缺少:

$ ls /home/yang/.ivy2/cache/org.scalatra/scalatra_2.9.1/jars/ 
scalatra_2.9.1-2.1.0-SNAPSHOT-sources.jar 

该文件存在于回购,虽然:

https://oss.sonatype.org/content/repositories/snapshots/org/scalatra/scalatra_2.9.1/2.1.0-SNAPSHOT/

即使我吹走~/.ivy2/,这仍然会发生。任何提示发生了什么?

填写以下build.sbt

name := "pod" 

version := "1.0" 

scalaVersion := "2.9.1" 

seq(coffeeSettings: _*) 

seq(webSettings :_*) 

seq(sbtprotobuf.ProtobufPlugin.protobufSettings: _*) 

libraryDependencies ++= Seq(
    "org.scalaquery" % "scalaquery_2.9.0" % "0.9.4", 
    "postgresql" % "postgresql" % "9.0-801.jdbc4", // % "runtime", 
    "com.jolbox" % "bonecp" % "0.7.1.RELEASE", 
    "ru.circumflex" % "circumflex-orm" % "2.1-SNAPSHOT", 
    "ru.circumflex" % "circumflex-core" % "2.1-SNAPSHOT", 
    "net.sf.ehcache" % "ehcache-core" % "2.4.3", 
    // snapshots needed for scala 2.9.0 support 
    "org.scalatra" %% "scalatra" % "2.1.0-SNAPSHOT", 
    "org.scalatra" %% "scalatra-scalate" % "2.1.0-SNAPSHOT", 
    "org.scalatra" %% "scalatra-fileupload" % "2.1.0-SNAPSHOT", 
    "org.fusesource.scalate" % "scalate-jruby" % "1.5.0", 
    "org.fusesource.scalamd" % "scalamd" % "1.5", // % runtime, 
    "org.mortbay.jetty" % "jetty" % "6.1.22", 
    "net.debasishg" % "sjson_2.9.0" % "0.12", 
    "com.lambdaworks" % "scrypt" % "1.2.0", 
    "org.mortbay.jetty" % "jetty" % "6.1.22" % "container", 
    // "org.bowlerframework" %% "core" % "0.4.1", 
    "net.sf.opencsv" % "opencsv" % "2.1", 
    "org.apache.commons" % "commons-math" % "2.2", 
    "org.apache.commons" % "commons-lang3" % "3.0", 
    "com.google.protobuf" % "protobuf-java" % "2.4.1", 
    "ch.qos.logback" % "logback-classic" % "0.9.29", 
    "org.scalatest" % "scalatest_2.9.0" % "1.6.1", 
    "com.h2database" % "h2" % "1.3.158", 
    "pentaho.weka" % "pdm-3.7-ce" % "SNAPSHOT", 
    // this line doesn't work due to sbt bug: 
    // https://github.com/harrah/xsbt/issues/263 
    // work around by manually downloading this into the lib/ directory 
    // "org.rosuda" % "jri" % "0.9-1" from "https://dev.partyondata.com/deps/jri-0.9-1.jar", 
    "net.java.dev.jna" % "jna" % "3.3.0", 
    "org.scalala" % "scalala_2.9.0" % "1.0.0.RC2-SNAPSHOT", 
    "rhino" % "js" % "1.7R2", 
    "junit" % "junit" % "4.9", 
    "org.apache.commons" % "commons-email" % "1.2", 
    "commons-validator" % "commons-validator" % "1.3.1", 
    "oro" % "oro" % "2.0.8", // validator depends on this 
    "javax.servlet" % "servlet-api" % "2.5" % "provided->default" 
) 

fork in run := true 

javaOptions in run ++= Seq(
    "-Xmx3G", 
    "-Djava.library.path=" + System.getenv("HOME") + 
    "/R/x86_64-pc-linux-gnu-library/2.13/rJava/jri:" + 
    "/usr/lib/R/site-library/rJava/jri" 
) 

//javaOptions in run ++= Seq(
// "-Dcom.sun.management.jmxremote", 
// "-Dcom.sun.management.jmxremote.port=3000", 
// "-Dcom.sun.management.jmxremote.authenticate=false", 
// "-Dcom.sun.management.jmxremote.ssl=false" 
//) 

scalacOptions ++= Seq("-g:vars", "-deprecation", "-unchecked") 

// needed for the scalatra snapshots 
resolvers ++= Seq(
    "POD" at "https://dev.partyondata.com/deps/", 
    "Scala-Tools Snapshots" at "http://scala-tools.org/repo-snapshots/", 
    "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/", 
    "Sonatype OSS releases" at "http://oss.sonatype.org/content/repositories/releases", 
    "ScalaNLP" at "http://repo.scalanlp.org/repo", 
    "Pentaho" at "http://repo.pentaho.org/artifactory/pentaho/", 
    "FuseSource snapshots" at "http://repo.fusesource.com/nexus/content/repositories/snapshots", 
    "JBoss" at "https://repository.jboss.org/nexus/content/repositories/thirdparty-releases" 
) 

initialCommands in consoleQuick := """ 
import scalala.scalar._; 
import scalala.tensor.::; 
import scalala.tensor.mutable._; 
import scalala.tensor.dense._; 
import scalala.tensor.sparse._; 
import scalala.library.Library._; 
import scalala.library.LinearAlgebra._; 
import scalala.library.Statistics._; 
import scalala.library.Plotting._; 
import scalala.operators.Implicits._; 
// 
import scala.collection.{mutable => mut} 
import scala.collection.JavaConversions._ 
import ru.circumflex.orm._ 
import ru.circumflex.core._ 
""" 

// 
// sxr 
// 

// addCompilerPlugin("org.scala-tools.sxr" %% "sxr" % "0.2.7") 
// 
// scalacOptions <+= (scalaSource in Compile) { "-P:sxr:base-directory:" + _.getAbsolutePath } 
+0

请出示配置文件 –

+0

@ DanielC.Sobral完成! – Yang

回答

13

吹走不只是〜/ .ivy2但是〜/ .m2目录后和〜/名.bst为好,一切又合作。

+0

真棒,谢谢!删除〜/ .ivy2中的内容为我解决了这个问题 – ferk86

1

我曾场合艾维得到了困惑。不幸的是,我不能告诉你为什么,但是我发现在删除整个〜/ .ivy2目录层次结构后,情况正常。显然,你必须再次下载你所有的依赖关系,但是: - (

+0

即使我吹走〜/ .ivy2 /,我仍然会发生这种情况。我会将此添加到我原来的问题中。 – Yang

4

有时常青藤缓存条目被破坏 - 只需删除~/.ivy2/cache/org.scalatra/scalatra_2.9.1/jars/,让SBT从远程仓库重新获取依赖关系。 ,尝试删除整个高速缓存目录(~/.ivy2/cache)。

+1

This is sti即使我吹走'〜/ .ivy2 /'....我会把这个添加到我原来的问题中。 – Yang