在本地运行我的应用程序时一切正常。我甚至跑了
rm -r ~/.m2
确保我重新下载所有内容。然而,当我部署到Heroku时,Heroku报告它无法下载commons-codec。自回购以来,我不认为这是回购的间歇性问题。 (当然,这可能是Heroku的一个间歇性问题......)
我无法找到任何我理解谷歌的东西(我仍然有点不清楚sbt究竟是如何工作的)。知道如何在Heroku上重新启动和运行吗?
[warn] [NOT FOUND ] commons-codec#commons-codec;1.5!commons-codec.jar (9ms)
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/commons-codec/commons-codec/1.5/commons-codec-1.5.jar
[info] downloading http://repo.typesafe.com/typesafe/releases/org/apache/httpcomponents/httpclient/4.1/httpclient-4.1.jar ...
[info] [SUCCESSFUL ] org.apache.httpcomponents#httpclient;4.1!httpclient.jar (101ms)
[info] downloading http://repo.typesafe.com/typesafe/releases/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar ...
[info] [SUCCESSFUL ] org.apache.httpcomponents#httpcore;4.1!httpcore.jar (90ms)
[info] downloading http://s3pository.heroku.com/maven-central/org/apache/httpcomponents/httpclient/4.1.2/httpclient-4.1.2.jar ...
[info] [SUCCESSFUL ] org.apache.httpcomponents#httpclient;4.1.2!httpclient.jar (457ms)
[info] downloading http://s3pository.heroku.com/maven-central/org/apache/httpcomponents/httpcore/4.1.3/httpcore-4.1.3.jar ...
[info] [SUCCESSFUL ] org.apache.httpcomponents#httpcore;4.1.3!httpcore.jar (450ms)
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: FAILED DOWNLOADS ::
[warn] :: ^ see resolution messages for details ^ ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: commons-codec#commons-codec;1.5!commons-codec.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/tmp/build_19dmxderfnxd/}Xonami WWW/*:update: sbt.ResolveException: download failed: commons-codec#commons-codec;1.5!commons-codec.jar
我的build.scala包含:
val appDependencies = Seq(
"org.hibernate" % "hibernate-c3p0" % "4.1.7.Final",
"org.hibernate" % "hibernate-entitymanager" % "4.1.7.Final",
"javax.servlet" % "servlet-api" % "2.5",
"spy" % "spymemcached" % "2.7.3",
"postgresql" % "postgresql" % "9.1-901.jdbc4",
"org.slf4j" % "slf4j-api" % "1.6.4",
"javax.mail" % "mail" % "1.4.4",
"com.thoughtworks.xstream" % "xstream" % "1.4.2",
"org.slf4j" % "slf4j-simple" % "1.6.4",
"org.jdom" % "jdom" % "1.1",
"junit" % "junit" % "4.10",
"com.amazonaws" % "aws-java-sdk" % "1.3.6",
"joda-time" % "joda-time" % "2.1",
"org.restlet.jee" % "org.restlet" % "2.1-RC3",
"org.restlet.jse" % "org.restlet.ext.jetty" % "2.1-RC3",
"org.restlet.jee" % "org.restlet.ext.json" % "2.1-RC3",
"org.restlet.jee" % "org.restlet.ext.servlet" % "2.1-RC3",
"org.restlet.jee" % "org.restlet.ext.xml" % "2.1-RC3",
"org.restlet.jee" % "org.restlet.ext.xstream" % "2.1-RC3",
"org.restlet.jee" % "org.restlet.ext.wadl" % "2.1-RC3",
"xalan" % "xalan" % "2.7.1",
"com.rabbitmq" % "amqp-client" % "3.0.2"
)
val main = PlayProject(appName, appVersion, appDependencies).settings(defaultScalaSettings:_*).settings(
resolvers += "spy" at "http://files.couchbase.com/maven2/",
resolvers += "project.local" at "file:${project.basedir}/repo",
resolvers += "repository.jboss.org-public" at "https://repository.jboss.org/nexus/content/groups/public",
resolvers += "maven-restlet" at "http://maven.restlet.org"
)
当我添加rabbitmq时问题就开始了,但即使我尝试删除它也似乎仍然存在。
答案 0 :(得分:4)
我遇到了this thread,建议我通过更改我的PlayProject功能“修复”此问题,如下所示:
val main = PlayProject(appName, appVersion, appDependencies).settings(defaultScalaSettings:_*).settings(
resolvers := Seq("typesafe" at "http://repo.typesafe.com/typesafe/repo"),
resolvers += "spy" at "http://files.couchbase.com/maven2/",
resolvers += "project.local" at "file:${project.basedir}/repo",
resolvers += "repository.jboss.org-public" at "https://repository.jboss.org/nexus/content/groups/public",
resolvers += "maven-restlet" at "http://maven.restlet.org"
)
我真的不喜欢这个,因为我不明白。我觉得我正在解决Heroku的问题。有人可以解释为什么这有效以及为什么它是正确的(或不正确的)?