jetty的初探索 发表于 2019-04-27 | 更新于: 2019-04-28 | 阅读次数: 字数统计: 309 | 阅读时长 ≈ 1 jetty9.4.17版本自定义项目名称以及运行端口的配置 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849<build> <!-- 打包之后的文件名称 --> <finalName>cloud</finalName> <plugins> <!-- jetty插件 --> <plugin> <!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-maven-plugin --> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.4.17.v20190418</version> <configuration> <webAppSourceDirectory>src/main/webapp</webAppSourceDirectory> <!-- 这种方式已经不适用,低版本或许可以 --> <!-- <contextPath>/cloud</contextPath> --> <!-- <connectors> <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> <port>8080</port> </connector> </connectors> --> <!-- http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html#configuring-your-webapp --> <scanIntervalSeconds>10</scanIntervalSeconds> <webApp> <contextPath>/cloud</contextPath> </webApp> <httpConnector> <port>8888</port> </httpConnector> </configuration> </plugin> </plugins> <!-- 打包jar --> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </pluginManagement> </build> 直接选择run as –> maven build 输入jetty:run 就能直接愉快的玩耍了啦! 谢谢,爱你么么哒 打赏 微信支付 支付宝 本文作者: 陈可牛 本文链接: http://www.gouzai.pw/2019/04/27/jetty的初探索/ 版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 许可协议。转载请注明出处!