2014-10-23 3 views
0

저는 (스칼라와 SBT를 사용하고 있습니다) JVM 개발에 익숙하며 의존성을 해결하는 데 문제가 있습니다.SBT 종속성을

[error] (*:update) sbt.ResolveException: unresolved dependency: com.mongodb.casbah#casbah_2.9.2;2.1.5-1: not found 
[error] unresolved dependency: org.scalatra#scalatra_2.9.2;2.3.0: not found 
[error] unresolved dependency: org.scalatra#scalatra-akka2_2.9.2;2.3.0: not found 
[error] unresolved dependency: org.scalatra#scalatra-specs2_2.9.2;2.3.0: not found 

내가 GitHub의에서 giter8 scalatra - MongoDB를 프로젝트 템플릿을 사용하고 있습니다 : click me 어제, 나는 문제가 org.restlet.2.1.1 의존성 오늘을 해결, 나는 다음과 같은 해결에 문제가 발생하고 있었다. 프로젝트가 조금 오래 되었기 때문에, 더 이상 존재하지 않거나 호환되는 오래된 버전을 얻으려는 이유가 있습니다. 이 상황에서 사람은 무엇을하나요? 내 build.sbt 파일에있는 버전 번호를 만지려고했지만이 작동하지 않았다 (그리고 더 나빠 보인다!). 내가 처음 템플릿을 생성 할 때, 나는 실종 종속성을받는 것을

addSbtPlugin("com.earldouglas" %% "xsbt-web-plugin" % "0.9.0") 

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.7.2") 

참고 : 다음은 내 plugins.sbt 파일입니다

scalaVersion := "2.9.2" 

mainClass := Some("JettyLauncher") 

seq(webSettings :_*) 

port in container.Configuration := 8080 

seq(assemblySettings: _*) 

libraryDependencies ++= Seq(
    "com.mongodb.casbah" %% "casbah" % "2.8.1-1", 
    "org.scalatra" %% "scalatra" % "2.2.0", 
    "org.scalatra" %% "scalatra-akka2" % "2.2.0", 
    "org.scalatra" %% "scalatra-specs2" % "2.2.0" % "test", 
    "org.mortbay.jetty" % "servlet-api" % "3.0.20100224" % "provided", 
    "org.eclipse.jetty" % "jetty-server" % "8.0.0.M3" % "container, compile", 
    "org.eclipse.jetty" % "jetty-util" % "8.0.0.M3" % "container, compile", 
    "org.eclipse.jetty" % "jetty-webapp" % "8.0.0.M3" % "container, compile" 
) 

resolvers ++= Seq(
    "Sonatype OSS" at "http://oss.sonatype.org/content/repositories/releases/", 
    "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/", 
    "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/", 
    "Akka Repo" at "http://akka.io/repository/", 
    "Web plugin repo" at "http://siasia.github.com/maven2" 
) 

:

다음 내 build.sbt 파일의 내용입니다 이 첫 번째 플러그인. 다행히도,이 플러그인에 대한 github 페이지는 업데이트 된 지침을 제공했으며이 종속성을 지나칠 수있었습니다.

어쨌든 모든 것을 작동시키는 데 필요한 이러한 종속성의 버전은 무엇입니까? 일반적으로 내가 버전 번호와 GitHub의 페이지와 바이올린을 방문보다 (다른 작업을 수행하는 것을 아무 생각)이없는 지금 (이러한 종속성을 해결하기위한 전략이 무엇인가? 모든 도움

감사합니다! 내가 가진

답변

0

. 적어도 그 가치가 무엇이든 내 종속성을 해결하기 위해 SBT 쪘 (가 ... 이제 클래스 경로 문제가) 어쨌든, 다음은 나의 새로운이며 build.sbt 파일 향상 :

scalaVersion := "2.10.4" 

mainClass := Some("JettyLauncher") 

seq(webSettings :_*) 

port in container.Configuration := 8080 

seq(assemblySettings: _*) 

libraryDependencies += "org.mongodb" %% "casbah-core" % "2.7.3" 

libraryDependencies += "org.scalatra" %% "scalatra" % "2.2.0-RC3" cross CrossVersion.binary 

libraryDependencies += "org.scalatra" %% "scalatra-akka" % "2.2.0-RC3" 

libraryDependencies += "org.scalatra" %% "scalatra-specs2" % "2.2.0" % "test" 

libraryDependencies += "org.mortbay.jetty" % "servlet-api" % "3.0.20100224" % "provided" 

libraryDependencies += "org.eclipse.jetty" % "jetty-server" % "9.0.0.M5" % "container" 

libraryDependencies += "org.eclipse.jetty" % "jetty-util" % "9.0.0.M5" % "container" 

libraryDependencies += "org.eclipse.jetty" % "jetty-webapp" % "9.0.0.M5" % "container" 

resolvers ++= Seq(
    "Sonatype releases" at "http://oss.sonatype.org/content/repositories/releases/", 
    "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/", 
    "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/", 
    "Akka Repo" at "http://akka.io/repository/", 
    "Web plugin repo" at "http://siasia.github.com/maven2" 
) 

정말 한 모든이 지출되었다 내 스카 버전 (2.10.4)과 호환되는 mvn 리포 지 토리를 검색하고 검색하는 데 몇 시간 씩 걸렸습니다. %%은 종속성 이름에 스칼라 버전을 추가합니다 (스칼라가 항상 진화하고 있기 때문에 멋진 규칙처럼 보입니다). 한 번, 나는 약간의 의존성을 해결했고, 나머지는 무너졌다.

관련 문제