I observed something really weird am unable to explain it. While trying to optimize the startup time of our spring boot application I made various changes, among other I updated the spring-boot-maven-plugin and the spring-boot-starter-parent to version 2.5.1.

I also activated:

spring:
  main:
    lazy-initialization: true

And moved our logback configuration to the application.yml:

logging:
  level:
    root: error
    org.springframework: error
  pattern:
    console: "%d %-5level %logger : %msg%n"
    file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
  file:
    name: "./logs/platform.log"
  logback:
    rollingpolicy:
      max-history: 45
      file-name-pattern: "./logs/platform-%d{yyyy-MM-dd}.log"
      total-size-cap: 1024MB

We were already using jetty as webserver by excluding tomcat from the spring-boot-starter-web dependency. After Updating to 2.5.1 two shocking things happened: - logging did not work properly anymore, it's seems like logback was not used anymore but instead slf4j? - the startup time more than doubled

The workarounds which I found: - use undertow, then logging works again as expected - revert to spring-boot-maven-plugin version 2.2.6.RELEASE

The jetty issues may be related to https://github.com/eclipse/jetty.project/issues/4572 but is still very weird and unexpected to me. The second issue however blows my mind, why would the startup time of the generated jar double when using a newer maven plugin?

Note that I am still using spring-boot-starter-parent version 2.5.1 (which also increased the startup time by a little bit).

What is the reason for this and how can we update the version without incurring these penalties?

Comment From: wilkinsona

The version of the Maven plugin dictates the version of the Spring Boot loader code that's used to launch your application. It hasn't changed dramatically between 2.2.x and 2.5.x, and certainly not in a way where a doubling of startup time is expected. Beyond that, I can't say much based on a description alone. If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.