pom文件配置:
加入jetty插件,貌似从9版本以后,包的路径都变了(以下是9.x版本)
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.5.v20170502</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<httpConnector>
<port>8080</port>
</httpConnector>
<webApp>
<contextPath>/bucket</contextPath>
</webApp>
</configuration>
</plugin>
下面是老版本
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.12.rc5</version>
<configuration>
<scanIntervalSeconds>13600</scanIntervalSeconds>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<webAppConfig>
<contextPath>/datapro-etl</contextPath>
</webAppConfig>
</configuration>
</plugin>
mvn启动方式命令:mvn jetty:run
下面截图表示正常的启动截图:
下面效果表示启动成功:
结束运行命令:Ctrl+c
按键盘的Ctrl+c 会出现下图的效果,然后输入y回车项目就会停止。
回车的效果: