After migrating from Spring Boot 2.3 to 2.5, I am getting an error when running the fatjar of the app as packaged by JKube on a docker image with image base adoptopenjdk/openjdk8:alpine. The whole strack is pure Boot's bootstrap, no domain classes anywhere, and the whole logging when the image is run consists on:

Exception in thread "main" java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0
    (...)
    at java.time.LocalDateTime.of(LocalDateTime.java:336)
        at org.springframework.boot.loader.jar.CentralDirectoryFileHeader.decodeMsDosFormatDateTime(CentralDirectoryFileHeader.java:130)
     (...)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)

I am surprised because this seems like an old fixed bug: https://github.com/spring-projects/spring-boot/issues/19518. Might it be a regression?

Comment From: wilkinsona

It looks like you're using an old version of CentralDirectoryFileHeader as in 2.5.5 line 130 is a }:

https://github.com/spring-projects/spring-boot/blob/34677508a76d0decad4ba2ced46ccfcf6804fb4a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/CentralDirectoryFileHeader.java#L130

Without knowing more about how you've packaged your application I can only speculate about how this has happened. A possible cause it that you're using Spring Boot 2.5.5 but with a downgraded version of its Maven plugin.

If this doesn't help you to pinpoint the cause and you'd like us to spend some more time investigating, please provide a minimal sample that reproduces the problem.

Comment From: nightswimmings

Oops... I spend so many time focused on the deployment debugging and the library itself that I totally missed this possiblity. Indeed, the maven plugin has an older version but for some reason it did not complain last 3 or 4 updates (that's the caveat of using spring-dependencies/bom instead of spring-boot-parent). Thanks a lot and sorry for the inconveniences. At least we have this diagnosis tracked down on the internet because I got crazy looking for the causes and it's so simple and obvious now..

Comment From: scottfrederick

Thanks for confirming the cause of the problem @nightswimmings.