当前位置: 代码迷 >> Web前端 >> maven中应用jetty服务器运行web应用
  详细解决方案

maven中应用jetty服务器运行web应用

热度:158   发布时间:2012-08-31 12:55:03.0
maven中使用jetty服务器运行web应用

1、在pom.xml文件中加入:

			<plugin>
				<groupId>org.mortbay.jetty</groupId>
				<artifactId>maven-jetty-plugin</artifactId>
				<version>6.1.10</version>
				<configuration>
					<scanIntervalSeconds>10</scanIntervalSeconds>
					<stopKey>foo</stopKey>
					<stopPort>9999</stopPort>
				</configuration>
				<executions>
					<execution>
						<id>start-jetty</id>
						<phase>pre-integration-test</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<scanIntervalSeconds>0</scanIntervalSeconds>
							<daemon>true</daemon>
						</configuration>
					</execution>
					<execution>
						<id>stop-jetty</id>
						<phase>post-integration-test</phase>
						<goals>
							<goal>stop</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

2、执行如下命令:

mvn jetty:run


3、如果在eclipse中运行(已安装m2eclipse),则如下:





  相关解决方案