2014-03-26 80 views
0

我有我的本地maven回購如下發布的jar。播放框架無法解析的依賴關係本地

[[email protected] 0.0.1]# ll 
total 108 
-rw-r--r--. 1 root root 98048 Mar 26 14:38 EtrackApiClient-0.0.1.jar 

-rwxrwxrwx. 1 root root 4980 Mar 26 14:30 EtrackApiClient-0.0.1.pom 

-rw-r--r--. 1 root root 182 Mar 26 14:38 _maven.repositories 

[[email protected] 0.0.1]# pwd 
/root/.m2/repository/com/ses/tools/etrack/EtrackApiClient/0.0.1 
[[email protected] 0.0.1]# 

我已經包含在Build.scala同一如下

val appDependencies = Seq(

// Add your project dependencies here, 
"mysql" % "mysql-connector-java" % "5.1.18", 
"org.mongodb" % "mongo-java-driver" % "2.11.1", 
"org.mongodb.morphia" % "morphia-logging-slf4j" % "0.105", 
"org.jsoup" % "jsoup" % "1.7.2", 
"com.google.code.gson" % "gson" % "1.7.1", 
"org.apache.commons" % "commons-io" % "1.3.2", 
"com.fasterxml.jackson.core" % "jackson-databind" % "2.2.3", 
"com.jcraft" % "jsch" % "0.1.50", 
"net.spy" % "spymemcached" % "2.10.0", 
"commons-lang" % "commons-lang" % "2.6", 
"javax.mail" % "mail" % "1.4.7", 
    "com.github.mumoshu" %% "play2-memcached" % "0.3.0.2", 
    "com.ses.tools.etrack" % "EtrackApiClient" % "0.0.1", 
javaCore, 
javaJdbc, 
javaEbean 
) 

val main = play.Project(appName, appVersion, appDependencies).settings( 

// Add your own project settings here 
//resolvers ++= Seq(Resolvers.LocalRepo, DefaultMavenRepository, Resolvers.githubRepository, Resolvers.morphiaRepository, Resolvers.spyRepository) 
resolvers += "Local Repository" at "file://root/.m2/repository", 
resolvers += "LeoDagDag repository" at "http://leodagdag.github.com/repository/", 
resolvers += "Dropbox repository" at "http://dl.dropbox.com/u/18533645/repository/", 
resolvers += "Morphia repository" at "http://morphia.googlecode.com/svn/mavenrepo/", 
resolvers += "Spy-Test Repository" at "http://files.couchbase.com/maven2" 

) 

當我嘗試建立項目中,我發現了以下錯誤

[warn] module not found: com.ses.tools.etrack#EtrackApiClient;0.0.1 

[warn] ==== local: tried 
[warn] /apps/play-2.1.3/repository/local/com.ses.tools.etrack/EtrackApiClient/0.0.1/ivys/ivy.xml 
[warn] ==== Typesafe Releases Repository: tried 
[warn] http://repo.typesafe.com/typesafe/releases/com/ses/tools/etrack/EtrackApiClient/0.0.1/EtrackApiClient-0.0.1.pom 
[warn] ==== Typesafe Snapshots Repository: tried 
[warn] http://repo.typesafe.com/typesafe/snapshots/com/ses/tools/etrack/EtrackApiClient/0.0.1/EtrackApiClient-0.0.1.pom 
[warn] ==== Local Repository: tried 
[warn] file://root/.m2/repository/com/ses/tools/etrack/EtrackApiClient/0.0.1/EtrackApiClient-0.0.1.pom 
[warn] ==== LeoDagDag repository: tried 
[warn] http://leodagdag.github.com/repository/com/ses/tools/etrack/EtrackApiClient/0.0.1/EtrackApiClient-0.0.1.pom 
[warn] ==== Dropbox repository: tried 
[warn] http://dl.dropbox.com/u/18533645/repository/com/ses/tools/etrack/EtrackApiClient/0.0.1/EtrackApiClient-0.0.1.pom 
[warn] ==== Morphia repository: tried 
[warn] http://morphia.googlecode.com/svn/mavenrepo/com/ses/tools/etrack/EtrackApiClient/0.0.1/EtrackApiClient-0.0.1.pom 
[warn] ==== Spy-Test Repository: tried 
[warn] http://files.couchbase.com/maven2/com/ses/tools/etrack/EtrackApiClient/0.0.1/EtrackApiClient-0.0.1.pom 
[warn] ==== public: tried 
[warn] http://repo1.maven.org/maven2/com/ses/tools/etrack/EtrackApiClient/0.0.1/EtrackApiClient-0.0.1.pom 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 
[warn] ::   UNRESOLVED DEPENDENCIES   :: 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 
[warn] :: com.ses.tools.etrack#EtrackApiClient;0.0.1: not found 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 
+0

我有ini要解決的問題是「在我的遊戲應用程序中添加第三方jar」。我通過將該jar放在應用程序的lib文件夾中來修復它。注意:在這樣做的時候,確保第三方jar和它的依賴關係一起構建。 –

回答

0

嘗試與當地代表解析器路徑:

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

我有這個解析器已經 –

+0

我的意思是當前的「根」 - >這個「+ Path.userHome.absolutePath +」。這在SBT書中顯示。不知道它會真正改變「根」,但可以嘗試。 – Thomson256