Jetty server configuration will be added as a maven plugin
<!--Jetty config--><build> <pluginManagement> <plugins> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.7.v20120910</version> <configuration> <webAppSourceDirectory>${project.build.directory}/[your proj name]</webAppSourceDirectory> <webApp> <!--You can put .properties file in configration folder other than resource folder--> <extraClasspath>${basedir}/configuration</extraClasspath> <contextPath>/[your proj name]</contextPath> <connectors> <!-- work around file locking on windows, this the app port --> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>8098</port> </connector> </connectors> <systemProperties> <systemProperty> <name>log4j.config.location</name> <value>${basedir}/configuration</value> <systemProperty> </systemProperty> <name>app.install.root</name> <value>${basedir}</value> </systemProperty> <systemProperty> <name>org.apache.jasper.compiler.disablejsr199</name> <value>true</value> </systemProperty> </systemProperties> </configuration> </plugin> <!--other plugins--> </plugins> </pluginManagement></build>
With this configuration, you should be able to use mvn jetty:run to start jetty server.
时间: 2024-10-12 20:56:35