码迷,mamicode.com
首页 > 其他好文 > 详细

How to add and configure jetty server in maven pom.xml

时间:2015-06-22 22:04:45      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:

Jetty server configuration will be added as a maven plugin

<!--Jetty config-->
<build>
  <pluginManagement>
  <plugins> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.7.v20120910</version> <configuration> <webAppSourceDirectory>${project.build.directory}/[your proj name]</webAppSourceDirectory> <webApp> <!--You can put .properties file in configration folder other than resource folder--> <extraClasspath>${basedir}/configuration</extraClasspath> <contextPath>/[your proj name]</contextPath> <connectors> <!-- work around file locking on windows, this the app port --> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>8098</port> </connector> </connectors> <systemProperties> <systemProperty> <name>log4j.config.location</name> <value>${basedir}/configuration</value> <systemProperty> </systemProperty> <name>app.install.root</name> <value>${basedir}</value> </systemProperty> <systemProperty> <name>org.apache.jasper.compiler.disablejsr199</name> <value>true</value> </systemProperty> </systemProperties> </configuration> </plugin> <!--other plugins--> </plugins>
   </pluginManagement>
</build>

With this configuration, you should be able to use mvn jetty:run to start jetty server.

How to add and configure jetty server in maven pom.xml

标签:

原文地址:http://www.cnblogs.com/sengao/p/4593886.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!