0

我有一个名为 Carpooling 的第一个项目,它是域项目。第二个项目是名为“proto-search”的 Play 2.0 项目

C:\Users\Java\.m2\repository我已经为 Carpooling 运行了 mvn install,并且 jar 目标与所有其他库一起位于其位置。

但是当我play run在“proto-search”目录中启动时,除了拼车依赖项之外,所有依赖项都已解决。我有 :

[warn]  module not found: com.s20#biim-model;1.3-SNAPSHOT
[warn] ==== local: tried
[warn]   D:\code\play-2.0.4\framework\..\repository/local/com.s20/biim-model/1.3
-SNAPSHOT/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/com/s20/biim-model/1.3-SNAPS
HOT/biim-model-1.3-SNAPSHOT.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn]   http://repo.typesafe.com/typesafe/snapshots/com/s20/biim-model/1.3-SNAP
SHOT/biim-model-1.3-SNAPSHOT.pom
[warn] ==== OSS Sonatype: tried
[warn]   http://oss.sonatype.org/content/repositories/releases/com/s20/biim-mode
l/1.3-SNAPSHOT/biim-model-1.3-SNAPSHOT.pom
[warn] ==== Local Maven Repository: tried
[warn]   file://C:/Users/Java/.m2/repository/com/s20/biim-model/1.3-SNAPSHOT/bii
m-model-1.3-SNAPSHOT.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/com/s20/biim-model/1.3-SNAPSHOT/biim-mode
l-1.3-SNAPSHOT.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.s20#biim-model;1.3-SNAPSHOT: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/D:/code/biiim/proto-search/}searchengine/*:update: sbt.ResolveExc
eption: unresolved dependency: com.s20#biim-model;1.3-SNAPSHOT: not found

我确实有文件C:/Users/Java/.m2/repository/com/s20/biim-model/1.3-SNAPSHOT/biim-model-1.3-SNAPSHOT.pom

我的平台目前是 Windows。我的队友都使用linux,没有问题。也许是file://不起作用,但我尝试了一些解决方法但没有成功。

任何的想法 ?

4

4 回答 4

3

在你的 Build.scala 中试试这个:

object ApplicationBuild extends Build {

val appName         = "airplane"
val appVersion      = "1.0-SNAPSHOT"

val appDependencies = Seq(
    "org.scalatest" % "scalatest_2.9.2" % "2.0.M4" % "test",
    "postgresql" % "postgresql" % "9.1-901-1.jdbc4"
)

// tip from http://www.scala-sbt.org/release/docs/Getting-Started/Library-Dependencies.html
resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository"

val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
  testOptions in Test := Nil  // hack to allow us to use scalatest for "play test" rather than specs2    
)    

}

于 2012-12-22T16:03:15.593 回答
1

向解析器值添加第三个正斜杠:

resolvers += "Local Maven Repository" at "file:///"+Path.userHome.absolutePath+"/.m2/repository"

于 2013-01-16T21:35:34.997 回答
1

based on what Todd Flanders answered, It worked for me using only one forward slash in the resolvers part:

resolvers += "Local Maven Repository" at "file:/"+Path.userHome.absolutePath+"/.m2/repository"

于 2013-05-10T02:31:45.867 回答
0

On Windows, I used an unmanaged dependency in the Play Framework. And I quickly moved to Linux and macOS where there was no problem.

于 2013-03-12T07:59:14.533 回答