6.6. 运行Web应用

一旦这个多模块项目已经通过从父项目simple-project执行mvn clean install行安装好了,你可以切换目录至simple-webapp项目,然后运行Jetty插件的Run目标。

~/examples/ch06/simple-parent/simple-webapp $ mvn jetty:run
[INFO] ----------------------------------------------------------------------
[INFO] Building simple-webapp Maven Webapp
[INFO]    task-segment: [jetty:run]
[INFO] ----------------------------------------------------------------------
[...]
[INFO] [jetty:run]
[INFO] Configuring Jetty for project: simple-webapp Maven Webapp
[...]
[INFO] Webapp directory = ~/examples/ch06/simple-parent/\
                          simple-webapp/src/main/webapp
[INFO] Starting jetty 6.1.6rc1 ...
2007-11-18 1:58:26.980::INFO:  jetty-6.1.6rc1
2007-11-18 1:58:26.125::INFO:  No Transaction manager found
2007-11-18 1:58:27.633::INFO:  Started [email protected]:8080
[INFO] Started Jetty Server

Jetty启动之后,在浏览器载入http://localhost:8080/simple-webapp/weather?zip=01201,你应该看到格式化的天气输出。