SBT,Jetty和Servlet 3.0 [英] SBT, Jetty and Servlet 3.0

查看:94
本文介绍了SBT,Jetty和Servlet 3.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很小的问题.

我有以下build.sbt文件:

I have the following build.sbt file:

name := "Tueet"

libraryDependencies += "org.eclipse.jetty" % "jetty-webapp" % "8.1.2.v20120308"

调用sbt更新后,我得到以下信息:

After invoking sbt update, I get the following:

[info] Set current project to Tueet (in build file:/C:/dev/tueet/)
[info] Updating {file:/C:/dev/tueet/}default-d5e982...
[info] Resolving org.scala-lang#scala-library;2.9.1 ...
[info] Resolving org.eclipse.jetty#jetty-webapp;8.1.2.v20120308 ...
[info] Resolving org.eclipse.jetty#jetty-xml;8.1.2.v20120308 ...
[info] Resolving org.eclipse.jetty#jetty-util;8.1.2.v20120308 ...
[info] Resolving org.eclipse.jetty#jetty-servlet;8.1.2.v20120308 ...
[info] Resolving org.eclipse.jetty#jetty-security;8.1.2.v20120308 ...
[info] Resolving org.eclipse.jetty#jetty-server;8.1.2.v20120308 ...
[info] Resolving org.eclipse.jetty.orbit#javax.servlet;3.0.0.v201112011016 ...
[info] Resolving org.eclipse.jetty#jetty-continuation;8.1.2.v20120308 ...
[info] Resolving org.eclipse.jetty#jetty-http;8.1.2.v20120308 ...
[info] Resolving org.eclipse.jetty#jetty-io;8.1.2.v20120308 ...
[warn]  [NOT FOUND  ] org.eclipse.jetty.orbit#javax.servlet;3.0.0.v201112011016!javax.servlet.orbit (603ms)
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/eclipse/jetty/orbit/javax.servlet/3.0.0.v201112011016/javax.servlet-3.0.0.v201112011016.orbit
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::              FAILED DOWNLOADS            ::
[warn]  :: ^ see resolution messages for details  ^ ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.eclipse.jetty.orbit#javax.servlet;3.0.0.v201112011016!javax.servlet.orbit
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/C:/dev/tueet/}default-d5e982/*:update: sbt.ResolveException: download     failed: org.eclipse.jetty.orbit#javax.servlet;3.0.0.v201112011016!javax.servlet.orbit
[error] Total time: 1 s, completed 2012-03-27 14:33:34

这很愚蠢,因为它在Maven no prob中工作.我发现这是因为Orbit会对包装进行某些操作(他们显然将其设置为Orbit).

This is silly, as it works in Maven no prob. I found out that this is because Orbit does something with packaging (they set it to orbit apparently).

我尝试做exclude("org.eclipse.jetty.orbit","javax.servlet"),但是什么也没发生,它仍然需要依赖.

I tried doing exclude("org.eclipse.jetty.orbit", "javax.servlet") but nothing happened and it still needed that dependency.

我找不到有关如何解决此问题的任何信息,也许有人会在这里帮助我:)

I couldn't find any info on how to actually fix this, maybe someone will help me here :)

更新:所提供的错误提供了一种解决方法,因此为了解决此问题,我实际上将build.sbt更改为

Update: the presented bug provides a workaround, so to fix this problem I actually changed build.sbt to

name := "Tueet"

libraryDependencies += "org.eclipse.jetty" % "jetty-server" % "8.1.2.v20120308"

ivyXML := 
<dependency org="org.eclipse.jetty.orbit" name="javax.servlet" rev="3.0.0.v201112011016">
<artifact name="javax.servlet" type="orbit" ext="jar"/>
</dependency>

推荐答案

查看此错误: https ://jira.codehaus.org/browse/JETTY-1493

问题的症结在于,常春藤不支持轨道扩展,需要将轨道包装类型映射到jar.不确定是否在使用ivy,但是根本原因是相同的,通过查看从maven Central下载的url可以看到.

The crux of the issue is that ivy doesn't support the orbit extension and needs to map the orbit packaging type to jar. Not sure if you're using ivy or not there, but the fundamental reason is the same, you can see that by looking at the url it is downloading from maven central.

此错误与我们首先切换到这些依赖项的原因有关.

This bug has a bit more of the background on the reason we switched to these dependencies in the first place.

https://bugs.eclipse.org/bugs/show_bug.cgi ?id = 371954

这篇关于SBT,Jetty和Servlet 3.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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