I have the following Maven code snippet
<plugin> <!-- http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin --> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.16</version> <configuration> <contextPath>/thomas</contextPath> <stopPort>9966</stopPort> <stopKey>foo</stopKey> </configuration> </plugin>
I want to set context path to "/" but the Jetty plugin doesn't respect it, the context falls back to using the folder (or maybe the module) name as the context path. If I set a context path with a name, for example:
<contextPath>/thomas</contextPath>
Any suggestions?
Thanks in advance.
You need to add [jetty maven plugin]( eclipse.org/jetty/documentation/9.4.x/jetty-maven-plugin.html) in your pom. xml file so you use jetty:run to launch your webapp in maven.
1.1 The 'groupId' is org. eclipse. jetty , by default, it runs on port 8080, in root context '/'.
port on the command line, for example, "mvn -Djetty. port=9999 jetty:run". Alternatively, you can specify as many connectors as you like.
FWIW this is what you need for jetty 8
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.7.v20120910</version> <configuration> <webApp> <contextPath>/</contextPath> </webApp> </configuration> </plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With