0

Background

Disclaimer: I have very little experience with Java.

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.

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.

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.

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"

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

Actual Question

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?

...

Related Question: Minimum set of files needed from Jetty to serve static content?

Community
  • 1
  • 1
James M. Greene
  • 1,251
  • 1
  • 16
  • 23

1 Answers1

1

You use it as a dependency for an embedded usage of jetty.

http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty

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.

jesse mcconnell
  • 7,102
  • 1
  • 22
  • 33
  • OK, so there is no executable class in the JAR to fire off? Fair enough... I guess I'll stick with the "start.jar". :-/ – James M. Greene May 14 '12 at 14:37
  • that is correct, jetty-start is the primary launch point in terms of executable jars, and all it basically does is calculate a reasonable classpath and then execute a main method in jetty-xml. jetty-runner is another executable jar that is basically an uber-jar which might suit your needs, but not if your planning on using the ant plugin. It would also be more then what your looking for since you want the minimal classes. – jesse mcconnell May 14 '12 at 15:02