在码头热部署简单的应用程序 [英] hot deploying simple application in jetty
问题描述
我目前正在使用jetty hightide vesion 7作为独立服务器。我有一个简单的Web项目,包含几个jsp和后备类,我目前正在未爆炸的战争中部署到JETTY_HOME / webapps目录。
I am working with jetty hightide vesion 7 currently as a stand alone server. I have a simple web project with a couple of jsp's and backing classes that I am currently deploying in an unexploded war to the JETTY_HOME/webapps directory.
目前,jetty很容易选择任何静态的jsp / html更改。如果我理解正确,我可以配置我的应用程序,以便jetty将在不重新启动服务器的情况下获取任何类更改?我目前在我的jetty-web.xml中:
Currently, jetty easily picks up any static jsp/html changes. If I understand correctly, I can configure my app so that jetty will pick up any class changes without restarting the server? I currently have in my jetty-web.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<!--
This is the jetty specific web application configuration file. When
starting a Web Application, the WEB-INF/web-jetty.xml file is looked
for and if found, treated as a
org.eclipse.jetty.server.server.xml.XmlConfiguration file and is
applied to the org.eclipse.jetty.servlet.WebApplicationContext objet
-->
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Call class="org.eclipse.jetty.util.log.Log" name="debug">
<Arg>executing jetty-web.xml</Arg>
</Call>
<Set name="contextPath">/SimpleDynamicProject</Set>
</Configure>
我还创建了一个SimpleDynamicProject.xml并将其放在JETTY_HOME / contexts中。此文件包含:
I also have created a SimpleDynamicProject.xml and put it in JETTY_HOME/contexts. This file contains:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<!--
This is the jetty specific web application configuration file. When
starting a Web Application, the WEB-INF/web-jetty.xml file is looked
for and if found, treated as a
org.eclipse.jetty.server.server.xml.XmlConfiguration file and is
applied to the org.eclipse.jetty.servlet.WebApplicationContext objet
-->
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/SimpleDynamicProject</Set>
<Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/webapps/SimpleDynamicProject</Set>
</Configure>
我也不确定如何在调试模式下正确启动Jetty,我也需要这样做。我尝试启动服务器:
I am also not sure how to correctly start Jetty in debug mode which I read was also needed. I have tried starting the server with:
java -Xdebug -jar start.jar OPTIONS=Server,jsp
和
java -Ddebug -jar start.jar OPTIONS=Server,jsp
这是我第一次使用码头,但到目前为止我真的很喜欢它。
This is the first time I've used jetty, but so far I really like it.
感谢您的帮助。
推荐答案
如果你想使用jetty maven插件
If you want to use jetty maven plugin
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.25</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<requestLog implementation="org.mortbay.jetty.NCSARequestLog">
<!--
This doesn't do anything for Jetty, but is a workaround for a
Maven bug that prevents the requestLog from being set.
-->
<append>true</append>
</requestLog>
<webApp>${basedir}/out/war/Spring2_5_6_war.war</webApp>
</configuration>
</plugin>
这篇关于在码头热部署简单的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!