I\'m trying to use jetty to host a simple helloworld servlet using maven. I\'m very confused.
I followed these instructions, but when I issue mvn jetty:run
Jetty has moved around a lot - see the History. Eclipse is the most recent home, as of 2009. The Maven artifacts have been renamed along the way, so your searches are finding documentation for older versions of Jetty and the maven plugin.
The latest (v9) jetty-maven-plugin documentation lists the dependency as:
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.0.0.v20130308</version> <!-- latest at time of writing -->
</plugin>
The other libraries like jetty-continuation or jetty-jsp are just sub-modules of the Jetty Project. Some documentation exists on the older wiki for Jetty 7 and 8 but I cannot see anything updated for v9 yet. The modular design is the Jetty developer's organisation of their code into well defined modules which have all been made available separately for developers that may want to use just want a small part of Jetty.
Here is the working config for me. Uses the latest Jetty version.
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.0.v20161208</version>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<contextXml>${basedir}/src/it/resources/jetty-context.xml</contextXml>
<webApp>
<contextPath>/yourContextPath</contextPath>
</webApp>
<contextHandlers>
<contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
<war>your/path.war</war>
<contextPath>/yourPath</contextPath>
</contextHandler>
</contextHandlers>
<classesDirectory></classesDirectory>
<webAppSourceDirectory></webAppSourceDirectory>
</configuration>
</plugin>
The eclipse version is the more recent one. Follow the instructions on their site.