我有一个Spring Boot 1.5.14应用程序,它还引入了我们构建的自定义库,该库也依赖于Spring Boot。这个库(也是Spring Boot 1.5.14)具有某些数据库实用程序,在其build.gradle中有:
compile 'org.postgresql:postgresql:42.2.2'
然而,当我将该库添加到我的应用程序编译依赖项中时,实际使用的postgres驱动程序版本(从运行“./gradlew dependencies”在应用程序中看到)为:
org.postgresql:postgresql:42.2.2 -> 9.4.1212.jre7
这会导致很多调试烦恼,因为应用程序无法打开到我正在尝试连接的AppEngine上的postgres实例的jdbc连接。听起来像这个问题中描述的同样的问题,因为postgres版本是在Spring Boot dependencies BOM中定义的。
我最终通过直接将compile 'org.postgresql:postgresql:42.2.2'
添加到我的应用程序的build.gradle
文件中来解决此问题...但我希望更好地理解为什么当我的库依赖项被拉取时,Spring Boot只会降级该版本。