Jetty提供静态内容所需的最少文件集? [英] Minimum set of files needed from Jetty to serve static content?

查看:115
本文介绍了Jetty提供静态内容所需的最少文件集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

免责声明:我对Java的经验很少.

Disclaimer: I have very little experience with Java.

我们以前在Ant构建过程中使用了Jetty 6的包装版本来处理按需静态内容(JS,CSS,图像,HTML),因此我们可以在HTTP托管的环境中使用PhantomJS运行单元测试.

We previously used a wrapped version of Jetty 6 for on-demand static content (JS, CSS, images, HTML) during our Ant build so we can run unit tests with PhantomJS against an HTTP-hosted environment.

但是,Jetty现在是8.1.3版,我们不再需要这种包装(它解决了一个现在尚无定论的不同问题),因此我想更新为直接使用Jetty 8.1.3.

However, Jetty is now on version 8.1.3 and we no longer need that wrapping (which solves a different problem which is now moot), so I wanted to update to just using Jetty 8.1.3 directly.

首先,我下载了整个Jetty发行版,其大小约为40 MB.这可以在Ant中使用"start.jar"来实现……但我真的不想在所有地方都使用那些不必要的JAR.

First I downloaded the whole Jetty distribution, which weighs in at a massive ~40 MB. This works from Ant, using "start.jar"... but I don't really want to be pushing those unnecessary JARs around everywhere.

因此,我从Maven存储库下载了聚合的"jetty-server-8.1.3.v20120416.jar"(最新),但是我似乎无法像使用"start.jar"那样从Ant中使用该JAR. ,例如"java -jar jetty-server-8.1.3.v20120416.jar OPTIONS =服务器"

So then I downloaded the aggregate "jetty-server-8.1.3.v20120416.jar" (latest) from the Maven repo, BUT I can't seem to use that JAR from Ant like I could with "start.jar", e.g. "java -jar jetty-server-8.1.3.v20120416.jar OPTIONS=Server"

Jetty文档既贫乏又不见(404). gh!

The Jetty documentation is both poor and missing (404's). Ugh!

因此,如果我回过头来使用Jetty的完整分发版而不是聚合的"jetty-server"和"start.jar",什么是完整的最小文件集(JAR和配置)我需要通过HTTP服务基本静态内容的Jetty分发吗?

So, if I go back to using the full distribution of Jetty with "start.jar" instead of the aggregate "jetty-server", what is the minimum set of files (JARs and configs) from the full Jetty distribution that I need to server basic static content over HTTP?

...

相关问题:如何从Ant启动聚合码头服务器JAR?

推荐答案

http://wiki. eclipse.org/Jetty/Howto/Use_Jetty_with_Ant

如果您不需要jetty-jmx或jetty-jndi之类的东西,则只需修剪

if you don't need things like jetty-jmx or jetty-jndi then just trim those

这篇关于Jetty提供静态内容所需的最少文件集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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