当我使用 jetty:run 运行 Maven 时,我收到此错误,我想在 eclipse 上运行一个 lift 项目,它在 macbook 和 PC 上都发生过:
Building FirstLiftweb Project 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-jetty-plugin:6.1.22:run (default-cli) @ FirstLiftweb >>>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.864s
[INFO] Finished at: Sun Apr 01 17:56:45 CEST 2012
[INFO] Final Memory: 10M/79M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project FirstLiftweb: Could not resolve dependencies for project
net.liftweb:FirstLiftweb:war:0.0.1-SNAPSHOT: Failed to collect dependencies for [net.liftweb:lift-mapper:jar:2.0 (compile), javax.servlet:servlet-api:jar:2.5 (provided),
junit:junit:jar:4.7 (test), org.mortbay.jetty:jetty:jar:[6.1.6,7.0) (test),
org.scala-lang:scala-compiler:jar:2.9.1 (test)]: No versions available
for javax.mail:mail:jar:[1.4,1.4.3) within specified range -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
我对此很陌生,所以如果你能帮助我,那就太好了,希望这里有一些 lift 社区,我在 Rails 和 php 上做了 python/django ruby 之后就抬起了,现在我想走 scala 方式,因为我想这是一种在 JVM 上运行的非常强大的语言,使其速度像火箭一样快,哈哈,
谢谢
更新
下面的解决方案已解决。重新启动我的笔记本电脑后,我还发现有更多选项可以通过 Maven 版本创建电梯项目。首先,我只能选择 net.liftweb,然后还有更多 net.liftweb 2.9.1 basic、空白等以及旧版本。 我还必须使用 AJDT 插件对 eclipse 进行一些调整,以便 lift 的调试工作正常。您必须激活它,然后右键单击项目>配置>转换为ajdt,干杯
最佳答案
我无法重现这个确切的错误,但看起来您正在尝试将旧版本的 Lift (2.0) 与 Scala 2.9.1 一起使用,这可能会导致此类问题。如果您发布 pom.xml
的相关部分,问题可能会更容易诊断。
您是否尝试过使用 Lift 的 Maven archetypes 之一? ?
更新:如果我将链接的 pom.xml
中的 scala.version
更改为 2.9.1
我可以重现您上面的错误。要修复该错误,您只需将 lift-mapper
依赖项更改为以下内容:
<dependency>
<groupId>net.liftweb</groupId>
<artifactId>lift-mapper_${scala.version}</artifactId>
<version>2.4</version>
</dependency>
这对我来说是编译的。
关于eclipse - 码头上的 Scala/Lift 错误 :run - maven - eclipse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9965929/