<plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.2.10.v20150310</version> <configuration> <httpConnector> <port>8090</port> </httpConnector> <stopPort>9966</stopPort> <stopKey>foo</stopKey> <scanIntervalSeconds>2</scanIntervalSeconds> <webApp> <!-- web项目根路径 --> <contextPath>/</contextPath> </webApp> </configuration> </plugin>
jetty 9 应 这样配置
<configuration> <httpConnector> <port>9090</port> </httpConnector> <webAppConfig> <contextPath>/${project.artifactId}</contextPath> </webAppConfig> </configuration>
tomcat7 插件:
<build> <finalName>emark-manager</finalName> <plugins> <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.1.0</version> <configuration> <warSourceExcludes>img/*/**</warSourceExcludes> </configuration> </plugin> --> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <port>81</port> <uriEncoding>UTF-8</uriEncoding> <path>/</path> </configuration> </plugin> </plugins> </build>