Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting "root" context path with Maven Jetty plugin

Tags:

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.

like image 312
Thomas Vervik Avatar asked Dec 31 '11 02:12

Thomas Vervik


People also ask

How do I use Maven jetty?

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.

What is the Artifactid of jetty maven plugin?

1.1 The 'groupId' is org. eclipse. jetty , by default, it runs on port 8080, in root context '/'.

What command execute the jetty plugin?

port on the command line, for example, "mvn -Djetty. port=9999 jetty:run". Alternatively, you can specify as many connectors as you like.


1 Answers

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> 
like image 83
Michael McCallum Avatar answered Sep 20 '22 00:09

Michael McCallum