简体   繁体   中英

What changed about loading Spring Resource file from classpath in Spring Boot in v1.5.12?

Prior to Spring Boot v1.5.11, the following worked for referring to a file called auth.json in src/main/resources : spring.cloud.gcp.credentials.location=auth.json

Starting with v1.5.11 and continuing through into 1.5.12, the above results in a FileNotFound exception. But the following works: spring.cloud.gcp.credentials.location=classpath:auth.json

What changed in Spring Boot 1.5.12 (or its underlying dependencies) that was responsible for this?

This was caused by a fix to another issue and is being tracked via another reported instance here: https://github.com/spring-projects/spring-boot/issues/12786

Practitioners hitting this behavior may either update their implementation in an appropriate way (eg, in our sanitized sample, it would be to prefix the property with "classpath:") or to wait to see if further resolution (that doesn't regress the other fix that caused this) is possible.

h/t @Stephane-Nicoll and Andy Wilkinson.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM