1.如果需要使用 run as --> maven build --> Goals 输入 jetty:run 来运行maven项目,那么必须在setting.xml配置: <pluginGroups> <pluginGroup>org.mortbay.jetty</pluginGroup> </pluginGroups> 或者:对应项目的pom.xml中plugins的节点下添加配置 <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <configuration> <webApp> <contextPath>/</contextPath> </webApp> <stopKey>webx</stopKey> <stopPort>9999</stopPort> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>8081</port> <maxIdleTime>60000</maxIdleTime> </connector> </connectors> <requestLog implementation="org.eclipse.jetty.server.NCSARequestLog"> <filename>target/access.log</filename> <retainDays>90</retainDays> <append>false</append> <extended>false</extended> <logTimeZone>GMT+8:00</logTimeZone> </requestLog> <systemProperties> <systemProperty> <name>productionMode</name> <value>${productionMode}</value> </systemProperty> </systemProperties> </configuration> </plugin>
2. tomacat 上运行,就不说了