spring-boot tomcat 切换至jetty

   <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <!--排除 tomcat-->
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!--排除 jetty-->
        <dependency>
          <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-jetty</artifactId>
  </dependency>


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.7.1)

2022-07-16 08:01:15.745  INFO 70305 --- [           main] com.example.demo.DemoApplication         : Starting DemoApplication using Java 1.8.0_271 on xmc000.local with PID 70305 (/Users/xmc/IdeaProjects/demo/target/classes started by xmc in /Users/xmc/IdeaProjects/demo)
2022-07-16 08:01:15.748  INFO 70305 --- [           main] com.example.demo.DemoApplication         : No active profile set, falling back to 1 default profile: "default"
2022-07-16 08:01:16.489  INFO 70305 --- [           main] org.eclipse.jetty.util.log               : Logging initialized @1609ms to org.eclipse.jetty.util.log.Slf4jLog
2022-07-16 08:01:16.577  INFO 70305 --- [           main] o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port: 8080
2022-07-16 08:01:16.579  INFO 70305 --- [           main] org.eclipse.jetty.server.Server          : jetty-9.4.48.v20220622; built: 2022-06-21T20:42:25.880Z; git: 6b67c5719d1f4371b33655ff2d047d24e171e49a; jvm 1.8.0_271-b09
2022-07-16 08:01:16.602  INFO 70305 --- [           main] o.e.j.s.h.ContextHandler.application     : Initializing Spring embedded WebApplicationContext
2022-07-16 08:01:16.602  INFO 70305 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 801 ms
2022-07-16 08:01:16.672  INFO 70305 --- [           main] org.eclipse.jetty.server.session         : DefaultSessionIdManager workerName=node0
2022-07-16 08:01:16.672  INFO 70305 --- [           main] org.eclipse.jetty.server.session         : No SessionScavenger set, using defaults
2022-07-16 08:01:16.673  INFO 70305 --- [           main] org.eclipse.jetty.server.session         : node0 Scavenging every 600000ms
2022-07-16 08:01:16.683  INFO 70305 --- [           main] o.e.jetty.server.handler.ContextHandler  : Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@5cbf9e9f{application,/,[file:///private/var/folders/37/0q77vwn52dg01fb_mbkdm0zc0000gn/T/jetty-docbase.8080.5575551599752862801/],AVAILABLE}
2022-07-16 08:01:16.684  INFO 70305 --- [           main] org.eclipse.jetty.server.Server          : Started @1805ms
2022-07-16 08:01:17.022  INFO 70305 --- [           main] o.e.j.s.h.ContextHandler.application     : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-07-16 08:01:17.022  INFO 70305 --- [           main] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2022-07-16 08:01:17.023  INFO 70305 --- [           main] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
2022-07-16 08:01:17.045  INFO 70305 --- [           main] o.e.jetty.server.AbstractConnector       : Started ServerConnector@669513d8{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2022-07-16 08:01:17.045  INFO 70305 --- [           main] o.s.b.web.embedded.jetty.JettyWebServer  : Jetty started on port(s) 8080 (http/1.1) with context path '/'
2022-07-16 08:01:17.053  INFO 70305 --- [           main] com.example.demo.DemoApplication         : Started DemoApplication in 1.632 seconds (JVM running for 2.175)
posted @ 2022-07-16 08:10  程序员熊明才  阅读(197)  评论(0编辑  收藏  举报