Same as this issue: https://github.com/spring-projects/spring-boot/issues/16034

org.springframework.core.io.AbstractFileResolvingResource will consider an empty file in runnable jar is unreadable.

image-20220225162730187

It cause different and confusing behavior after mvn package.

I think empty folders can indeed be considered unreadable, but files should not be the same.

Do you have any plans to fix it?

Comment From: rstoyanchev

Please, don't use images to point to code that is already on GitHub. While the image shows more, most often, other surrounding code needs to be examined too. So this is just not helpful and bloats the issue description.

Comment From: rstoyanchev

An argument about how an empty file should be treated, could be made on both sides. Considering the present behavior is now long standing, and the implementation issues described in https://github.com/spring-projects/spring-framework/issues/21372#issuecomment-453471835, it makes no sense to change this, and disrupt others who already depend on the present behavior.

I'm closing this but it can be re-opened if there is enough interest. Feel free to leave a comment with more details on the actual use case of how this happens.