码头上的Scala/Lift错误:运行-Maven-Eclipse [英] Scala/Lift error on jetty:run - maven - eclipse

查看:72
本文介绍了码头上的Scala/Lift错误:运行-Maven-Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我用jetty:run运行Maven时出现此错误,我想在eclipse上运行一个lift项目,这在Macbook和PC上都发生在我身上:

I get this error when i run Maven with jetty:run, I wanna run a lift project on eclipse, it happened to me on macbook as well as on 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

这是我的新手,如果您能帮助我,我会很高兴,希望这里有一些电梯社区,我只是在用rails和php做python/django ruby​​之后就电梯了,现在我想使用scala方式,因为我认为这是一种在JVM上运行的非常强大的语言,使其像火箭一样迅速哈哈,

Im new to this so would be nice if you could help me out, hopefully there is some lift community here, I just lift after doing python/django ruby on rails and php, now I wanna go the scala way cause I think this is a very powerful language running on JVM which makes it fast as a rocket haha,

谢谢

更新

以下解决方案已解决.在重新启动笔记本电脑后,Ive还看到在按版本进行Maven创建升降机项目时,还有更多选择.首先,我只能选择net.liftweb,然后有更多的net.liftweb 2.9.1基本版本,空白版本和旧版本. 我还必须使用AJDT插件对月食进行一些调整,以使Lift的调试工作正常.您必须激活它,然后右键单击项目>配置>转换为ajdt,加油

The solution below worked out. Ive also seen after restarting my laptop that there was more options on creating lift projects by versions with maven. First I only had the choice to select net.liftweb then there was more net.liftweb 2.9.1 basic, blank etc and older versions. I also had to adjust eclipse a bit with the AJDT plugin so the debug for lift works correctly. You have to activate it and then right click on the project > configure > convert to ajdt, cheers

推荐答案

我无法重现此确切错误,但是您似乎正在尝试将旧版本的Lift(2.0)与Scala 2.9.1配合使用,这很可能会导致这种问题.如果您发布pom.xml的相关部分,则该问题可能更易于诊断.

I can't reproduce this exact error, but it looks like you're trying to use an old version of Lift (2.0) with Scala 2.9.1, which is likely to cause this kind of problem. If you post the relevant parts of your pom.xml the problem might be easier to diagnose.

您是否尝试过使用Lift的 Maven原型之一?

Have you tried using one of Lift's Maven archetypes?

更新:如果我将链接的pom.xml中的scala.version更改为2.9.1,则可以在上面重现您的错误.要修复该错误,您需要做的就是将lift-mapper依赖项更改为以下内容:

Update: If I change scala.version in your linked pom.xml to 2.9.1 I can reproduce your error above. To fix the error, all you need to do is change the lift-mapper dependency to the following:

<dependency>
  <groupId>net.liftweb</groupId>
  <artifactId>lift-mapper_${scala.version}</artifactId>
  <version>2.4</version>
</dependency>

这为我编译.

这篇关于码头上的Scala/Lift错误:运行-Maven-Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆