##**使用org.eclipse.jetty:jetty-maven-plugin设置服务器端口和contextPath 目前使用的jetty-maven-plugin的版本是9.4.27.v20200227 主要有三种方式来改变:
**
1.仅在运行时更改端口:
mvn jetty:run -Djetty.http.port=9999
2.在你的pom.xml文件中设置属性:
<jetty.http.port>9999</jetty.http.port>
然后运行:
mvn jetty:run
3.在pom.xml文件中的插件声明中设置端口
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.27.v20200227</version>
<configuration>
<webAppConfig>
<contextPath>/“自己填”</contextPath>
</webAppConfig>
<httpConnector>
<!--host>localhost</host-->
<port>9999</port>
</httpConnector>
</configuration>
</plugin>