Кто-нибудь испытал очень медленное время запуска Spring Boot 2.0 на MacOS Sierra?

Мой pom - это не что иное (фрагмент):

...
 <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.0.RELEASE</version>
  </parent>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    ...

Запуск занимает 22 секунды:

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

2018-03-13 23:24:58.160  INFO 20517 --- [           main] jekyll.publisher.ServerApplication       : Starting ServerApplication on MacBook-Pro.local with PID 20517 (/Users/workspace/jekyll-publisher/target/classes started by xxxx in /Users/workspace/jekyll-publisher)
2018-03-13 23:24:58.163  INFO 20517 --- [           main] jekyll.publisher.ServerApplication       : No active profile set, falling back to default profiles: default
2018-03-13 23:24:58.190  INFO 20517 --- [           main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@8909f18: startup date [Tue Mar 13 23:24:58 EDT 2018]; root of context hierarchy
2018-03-13 23:24:58.736  INFO 20517 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2018-03-13 23:24:58.748  INFO 20517 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2018-03-13 23:24:58.749  INFO 20517 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.28
2018-03-13 23:24:58.752  INFO 20517 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2018-03-13 23:24:58.795  INFO 20517 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2018-03-13 23:24:58.795  INFO 20517 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 607 ms
2018-03-13 23:24:58.878  INFO 20517 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-03-13 23:24:58.879  INFO 20517 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-03-13 23:24:58.879  INFO 20517 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-03-13 23:24:58.879  INFO 20517 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2018-03-13 23:24:58.879  INFO 20517 --- [ost-startStop-1] .s.DelegatingFilterProxyRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*]
2018-03-13 23:24:58.880  INFO 20517 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]
2018-03-13 23:24:58.902  INFO 20517 --- [           main] j.publisher.web.ping.PingController      : Ping on the server was successful.
2018-03-13 23:24:59.044  INFO 20517 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@8909f18: startup date [Tue Mar 13 23:24:58 EDT 2018]; root of context hierarchy
2018-03-13 23:24:59.081  INFO 20517 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],methods=[POST],produces=[text/html]}" onto public java.lang.String jekyll.publisher.web.error.ForwardingErrorController.forwardOnError()
2018-03-13 23:24:59.084  INFO 20517 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/ping],methods=[GET]}" onto public jekyll.publisher.web.ping.PingResponse jekyll.publisher.web.ping.PingController.ping(javax.servlet.http.HttpSession)
2018-03-13 23:24:59.103  INFO 20517 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-13 23:24:59.104  INFO 20517 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-13 23:24:59.123  INFO 20517 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-13 23:24:59.134  INFO 20517 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page: class path resource [static/index.html]
2018-03-13 23:24:59.225  INFO 20517 --- [           main] .s.s.UserDetailsServiceAutoConfiguration : 

Using generated security password: 8edea141-84e2-4ab5-b799-0cf09c464b53

2018-03-13 23:24:59.324  INFO 20517 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: org.springframework.security.web.util.matcher.AnyRequestMatcher@1, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@6813a331, org.springframework.security.web.context.SecurityContextPersistenceFilter@22df874e, org.springframework.security.web.header.HeaderWriterFilter@377c68c6, org.springframework.security.web.csrf.CsrfFilter@3961a41a, org.springframework.security.web.authentication.logout.LogoutFilter@537b32ef, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@607b2792, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@261d8190, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@99a65d3, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@5bdaf2ce, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@778ca8ef, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@1bd81830, org.springframework.security.web.session.SessionManagementFilter@238ad8c, org.springframework.security.web.access.ExceptionTranslationFilter@7d0332e1, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@76adb233]
2018-03-13 23:24:59.373  INFO 20517 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2018-03-13 23:24:59.406  INFO 20517 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2018-03-13 23:24:59.409  INFO 20517 --- [           main] jekyll.publisher.ServerApplication       : Started ServerApplication in 16.429 seconds (JVM running for 22.012)

Любые идеи?

Хорошо, StackOverflow заставляет меня добавить «больше деталей». Не уверен, что еще добавить сюда.

0
user1902183 14 Мар 2018 в 06:32

2 ответа

Лучший ответ

Хорошо, разобрался. Это не имело ничего общего с Spring Boot 2.0. Просто совпало с этим обновлением.

Настоящий ответ - из этого StackOverflow: Maven с Surefire (TestNG) работает медленно после обновления в MacOS Sierra

1
user1902183 21 Мар 2018 в 00:53

Установите это так

  1. откройте свой терминал и запустите hostname
$ hostname
xxx.local
  1. изменить конфигурацию хоста в файле /etc/hosts
127.0.0.1       localhost       xxx.local
::1             localhost       xxx.local
0
Tiago Martins Peres 李大仁 26 Фев 2019 в 10:13