我有一个名为Carpooling的第一个项目,这是域项目。第二个项目是一个名为"proto-search"的Play 2.0项目
我已经运行了mvn install for Carpooling,并且jar目标与所有其他库一起位于C:UsersJava.m2repository
中的位置。
但是当我在"proto-search"目录下启动play run
时,除了Carpooling之外,所有依赖项都被解析了。我有:
[warn] module not found: com.s20#biim-model;1.3-SNAPSHOT
[warn] ==== local: tried
[warn] D:codeplay-2.0.4framework..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,没有问题。也许是文件://不起作用,但我尝试了一些解决方法,但没有成功。
在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
)
}
给resolvers的值添加第三个斜杠:
resolvers += "Local Maven Repository" at "file:///"+Path.userHome.absolutePath+"/.m2/Repository"
根据Todd Flanders的回答,在解析器部分只使用一个正斜杠对我有效:
resolvers += "Local Maven Repository" at "file:/"+Path.userHome.absolutePath+"/.m2/Repository"
在Windows上,我在Play框架中使用了非托管依赖项。我很快就转向了Linux和macOS,在那里没有问题。