我的jar在我当地的maven repo中发布如下。
[root@localhost 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
[root@localhost 0.0.1]# pwd
/root/.m2/repository/com/ses/tools/etrack/EtrackApiClient/0.0.1
[root@localhost 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 :(得分:0)
尝试使用本地代表解析器路径:
resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository"