Jetty 提供静态内容所需的最少文件集?
免责声明:我非常使用 Java.
我们之前在 Ant 构建期间使用 Jetty 6 的封装版本来处理按需静态内容(JS、CSS、图像、HTML),以便我们可以使用 PhantomJS 针对 HTTP 托管环境运行单元测试.
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=Server"
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).呃!
The Jetty documentation is both poor and missing (404's). Ugh!
所以,如果我回到使用带有start.jar"而不是聚合jetty-server"的 Jetty 的完整发行版,完整的文件(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