Maven学习之17使用jetty来发布webapps(成功)

来源:互联网 发布:安卓java模拟器apk 编辑:程序博客网 时间:2024/05/20 22:01


在参考【1】中安装失败

故再次尝试成功了:


1.pom:

<plugin><groupId>org.mortbay.jetty</groupId><artifactId>jetty-maven-plugin</artifactId><version>8.1.16.v20140903</version><configuration><scanIntervalSeconds>10</scanIntervalSeconds><webApp><contextPath>/kk</contextPath></webApp><connectors><connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"><port>8787</port><maxIdleTime>60000</maxIdleTime></connector></connectors></configuration></plugin>


2.运行:

run as -》build-》jetty:run


3.浏览:

http://127.0.0.1:8787/kk/

10s中更新一次


显示:





4. 遇到的错误:

 No plugin found for prefix 'jetty' in the current project and in the plugin groups

解决;

<dependencies>中加入jetty,先下载,就不会报错了

  <pre name="code" class="plain"><dependencies>
<dependency><groupId>org.mortbay.jetty</groupId><artifactId>jetty-maven-plugin</artifactId><version>8.1.16.v20140903</version></dependency></dependencies>





参考:

【1】 http://blog.csdn.net/xubo245/article/details/51370020

0 0