<plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.2.3.v20140905</version> <configuration> <stopPort>9966</stopPort> <stopKey>stop</stopKey> <!-- Listen to port 8983 --> <httpConnector> <port>8983</port> <idleTimeout>60000</idleTimeout> </httpConnector> <reload>automatic</reload> <!-- Read system properties from profile specific configuration file --> <!--<systemPropertiesFile>${project.basedir}/profiles/${build.profile.id}/config.properties</systemPropertiesFile>--> <!-- Set the context path --> <webApp> <contextPath>/zhixin-search</contextPath> </webApp> </configuration> </plugin>
启动:
mvn -Dslf4j=false -Dlog4j.configuration=file:./target/classes/log4j.properties jetty:run -Djetty.reload=automatic -Djetty.scanIntervalSeconds=10
重新加载会耗费大量内存,这也是一个通病!