Eclipse Maven Jetty集成

1、添加项目

 

2、选择maven-archetype-webapp

3、添加公司/组织名称,项目名称,版本号

4、补全未生成的文件夹

5、pom.xml中添加jetty插件信息

<plugins>
	<plugin>
		<groupId>org.mortbay.jetty</groupId>
		<artifactId>maven-jetty-plugin</artifactId>
		<version>6.1.9</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>
</plugins>

6、执行 mvn jett:run

D:\workspace201408\sshdemo>mvn jetty:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sshdemo Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-jetty-plugin:6.1.9:run (default-cli) > test-compile @ sshdemo >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ sshdemo ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ sshdemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ sshdemo ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\workspace201408\sshdemo\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ sshdemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< maven-jetty-plugin:6.1.9:run (default-cli) < test-compile @ sshdemo <<<
[INFO]
[INFO] --- maven-jetty-plugin:6.1.9:run (default-cli) @ sshdemo ---
[INFO] Configuring Jetty for project: sshdemo Maven Webapp
[INFO] Webapp source directory = D:\workspace201408\sshdemo\src\main\webapp
[INFO] web.xml file = D:\workspace201408\sshdemo\src\main\webapp\WEB-INF\web.xml
[INFO] Classes = D:\workspace201408\sshdemo\target\classes
[INFO] Logging to org.slf4j.impl.SimpleLogger(org.mortbay.log) via org.mortbay.log.Slf4jLog
[INFO] Context path = /sshdemo
[INFO] Tmp directory =  determined at runtime
[INFO] Web defaults = org/mortbay/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[INFO] Webapp directory = D:\workspace201408\sshdemo\src\main\webapp
[INFO] Starting jetty 6.1.9 ...
[INFO] jetty-6.1.9
[INFO] No Transaction manager found - if your webapp requires one, please configure one.
[INFO] Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server

7、访问http://localhost:8080/sshdemo/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值