maven-jetty-plugin始终在默认上下文路径('/')上运行应用程序。我尝试通过将contextpath属性设置为'test‘来运行,但它不起作用。无法访问http://localhost:8080/test。它仍然在默认的上下文路径上运行。
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>9.1.0.M0</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<webApp>
<contextPath>/test</contextPath>
</webApp>
<connectors>
<!-- work around file locking on windows -->
<connector implementation="org.mortbay.jetty.bio.SocketConnector">
<port>8080</port><!-- this connector defaults to 1300 for some reason -->
</connector>
</connectors>
</configuration>
</plugin>发布于 2016-12-09 05:24:02
仅使用
<contextPath>/test</contextPath>而不是
<webApp>
<contextPath>/test</contextPath>
</webApp>对我很管用
https://stackoverflow.com/questions/23992781
复制相似问题