IDEA uses Maven to configure the Jetty server

import plugin

<plugins>
       <!-- Jetty插件   -->
       <plugin>
           <groupId>org.eclipse.jetty</groupId>
           <artifactId>jetty-maven-plugin</artifactId>
           <version>9.4.27.v20200227</version>
           <configuration>
               <scanIntervalSeconds>10</scanIntervalSeconds>
               <!--                        设置上下文-->
               <webApp>
                   <contextPath>/demo</contextPath>
               </webApp>
           </configuration>
       </plugin>
</plugins>

import dependencies

 <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5-20081211</version>
    </dependency>

After updating the resources, a Jetty will be found in the plugin

insert image description here

click to start

insert image description here
The Jetty server is successfully configured.

Guess you like

Origin blog.csdn.net/weixin_53236380/article/details/127424220