如何从 Ant 启动聚合码头服务器 JAR? [英] How to start an aggregate jetty-server JAR from Ant?
问题描述
免责声明:我非常使用 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 存储库,但是我似乎无法像使用 Ant 那样使用来自 Ant 的 JARstart.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!
我到底要怎么处理这个聚合的码头服务器"JAR?我应该指向一个特定的类而不是整个 JAR 吗?
What the heck do I do with this aggregate "jetty-server" JAR? Should I be pointing to a particular class instead of the whole JAR?
...
相关问题: Jetty 提供静态内容所需的最少文件集?
推荐答案
您将其用作嵌入式使用 jetty 的依赖项.
You use it as a dependency for an embedded usage of jetty.
http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty
它不适合与 start.jar 一起使用,这是一种将适合用于启动 jetty 的类路径编织在一起的机制,而不是作为通用的 jar 启动器.
it is not appropriate for usage with the start.jar, that is a mechanism for knitting together a classpath suitable to launch jetty with, not as a generalized jar launcher.
这篇关于如何从 Ant 启动聚合码头服务器 JAR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!