maven之jetty-maven-plugin插件
2016-01-28 20:15
232 查看
在各种学习体验和项目实战中,发现jetty比tomcat在开发方面更加的方便和好用,所以,下面就留下我的笔记,这个例子的代码还是接着上面的maven搭建的例子,jetty在maven中的使用方法如下:
步骤一:
在tian-parent中的插件管理中添加:
步骤二:
在tian-web中的插件中加入:
在tian-web的pom.xml中运行clean package jetty:run就会在控制台看到jetty已经启动,
在浏览器中输入你配置的路径,比如本实例,我配置的是
就可以看到我的网页结果了,jetty可以配置一个检查更新的比如10s等,不用我们再去手动的打包编译等动作,这个就比tomcat的方便多了。
注
在我的配置过程中,也是出现了好多错误,真心感觉百度简直就是恶心人,大家想办法翻墙Google吧,花费了n天再次体会到技术的东西,百度跟谷歌的差距不是用时间就能解决的。
步骤一:
在tian-parent中的插件管理中添加:
<plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.3.7.v20160115</version> <configuration> <webApp> <contextPath>/hello</contextPath> </webApp> <scanIntervalSeconds>10</scanIntervalSeconds> <stopPort>9899</stopPort> <stopKey>foo</stopKey> <stopWait>10</stopWait> <systemProperties> <systemProperty> <name>tapestry.execution-mode</name> <value>development</value> </systemProperty> <systemProperty> <name>jetty.port</name> <value>9090</value> </systemProperty> </systemProperties> </configuration> <executions> <execution> <id>start-jetty</id> <phase>pre-integration-test</phase> <goals> <goal>run</goal> </goals> <configuration> <daemon>true</daemon> </configuration> </execution> <execution> <id>stop-jetty</id> <phase>post-integration-test</phase> <goals> <goal>stop</goal> </goals> </execution> </executions> </plugin>
步骤二:
在tian-web中的插件中加入:
<plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> </plugin>
在tian-web的pom.xml中运行clean package jetty:run就会在控制台看到jetty已经启动,
在浏览器中输入你配置的路径,比如本实例,我配置的是
http://127.0.0.1:9090/hello/HelloServlet
就可以看到我的网页结果了,jetty可以配置一个检查更新的比如10s等,不用我们再去手动的打包编译等动作,这个就比tomcat的方便多了。
注
在我的配置过程中,也是出现了好多错误,真心感觉百度简直就是恶心人,大家想办法翻墙Google吧,花费了n天再次体会到技术的东西,百度跟谷歌的差距不是用时间就能解决的。
相关文章推荐
- Win7环境下如何开启802.1X 无线网络认证
- linq语句:分组统计 broup by +sum
- android TextView实现跑马灯效果
- 【瞎搞】 HDU 3101 The Heart of the Country
- 南阳oj 5 Binary String Matching
- java四则混合运算工具类备忘
- 测试必备技能系列1 :通过mysql命令进行脚本数据导入
- Android学习-----Android Studio 2.0 预览版下载
- 学习笔记2
- 今天在做HDU1495的时候看到了一个代码
- POJ 3669 -- BFS
- html image -- data:image/png;base64
- eclipse中JS文件乱码
- c# Attribute
- 可添加Header可下拉刷新的RecyclerView
- apache commons io 问题跟踪
- 排序
- 从红包爆发季到来前 看为何难有百年社交?
- Gearman GearmanClient 函数列表
- 关于出场