put the static content in any folder below /yourStaticApp/src/main/webapp - say, under /yourStaticApp/src/main/webapp/static . When you start Jetty, they will be available as http://host:port/contextRoot/static/fileName.ext
Hmmm, unsure if possible. The Eclipse Jetty Maven plugin documents a way to configure the location of a static source, which boils down to the alternative webapps location mentioned above.
... <plugin> ... <configuration> <webAppSourceDirectory>${basedir}/src/staticfiles</webAppSourceDirectory> ... </configuration> ... </plugin> ...
As the dock points out:
<webAppSourceDirectory> . By default, this parameter is set to $ {basedir} / src / main / webapp. If your static sources are located elsewhere, set this option accordingly.
refer: http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin
Update: Another study revealed that you can specify the location of webdefault.xml from the Jetty-maven plugin; and in webdefault.xml you can configure static content.
In the Jetty Maven configuration, specify the location of the wendefault.xml file
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <configuration> ... <defaultsDescriptor>/my/path/to/webdefault.xml</defaultsDescriptor> ... </configuration> </plugin>
Now, using webdefault.xml in your hand, you can specify the configuration webdefault.xml here: http://docs.codehaus.org/display/JETTY/Static+Content - except that the package names have been changed from org.mortbay.jetty... at org.eclipse.jetty... below:
<Configure class="org.eclipse.jetty.servlet.Context"> <Set name="contextPath">/javadoc</Set> <Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/javadoc/</Set> <Call name="addServlet"> <Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg> <Arg>/</Arg> </Call> </Configure>
: http://wiki.eclipse.org/Jetty/Reference/webdefault.xml
I have not tested / used above. But let me know if you do. Or if something else is needed for this.