1. 程式人生 > >jetty 去掉專案名稱訪問

jetty 去掉專案名稱訪問

在開發的專案軟體上線之前一般需要去掉專案的名稱,之前用的Tomcat 網上有很多的資料可以自行查詢,然而今天就把jetty下的配置寫一下

我所使用的是maven進行管理,只需要在pom.xml中進行如下配置

詳細配置:

<build>
<finalName>maven02</finalName>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.8.v20150217</version>
<configuration>
<httpConnector>
<port>80</port>
</httpConnector>

<webAppConfig>
<contextPath>/contextPath>
</webAppConfig>
<webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>

<stopKey>shutdown</stopKey>
<stopPort>9966</stopPort>
</configuration>
</plugin>
</plugins>
</build>

主要配置:

<webAppConfig>
<contextPath>/contextPath>
</webAppConfig>

這樣就可以了。

如果對你有幫助不要忘了點贊啊奮鬥