我有一个名为Carpooling的第一个项目是域项目。第二个项目是一个名为“proto-search”的Play 2.0项目
我已经为carpooling运行了mvn install,并且jar目标位于C:\Users\Java\.m2\repository
以及所有其他库中。
但是当我在“proto-search”目录中启动play run
时,除了拼接一个依赖关系之外,所有依赖关系都会被解析。我有:
[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:// 不起作用,但我尝试了一些解决方法但没有成功。
有什么想法吗?
答案 0 :(得分: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
)
}
答案 1 :(得分:1)
为解析器值添加第三个正斜杠:
解析器+ =“本地Maven存储库”位于“file:///”+ Path.userHome.absolutePath +“/。m2 / repository”
答案 2 :(得分:1)
根据Todd Flanders的回答,在解析器部分只使用了一个正斜杠,这对我有用:
解析器+ =“本地Maven存储库”位于“file:/”+ Path.userHome.absolutePath +“/。m2 / repository”
答案 3 :(得分:0)
在Windows上,我在Play Framework中使用了非托管依赖项。我很快就转移到Linux和macOS,没有任何问题。