【发布时间】:2018-07-18 15:05:56
【问题描述】:
我有一个 Spring Boot 1.5.14 应用程序,它还引入了一个我们构建的自定义库,该库也依赖于 Spring Boot。这个库(也是 Spring Boot 1.5.14)有一些数据库实用程序,在它的 build.gradle 中有:
compile 'org.postgresql:postgresql:42.2.2'
但是,当我将该库添加到我的应用程序编译依赖项时,实际使用的 postgres 驱动程序版本(从在应用程序中运行 `./gradlew 依赖项可以看出):
org.postgresql:postgresql:42.2.2 -> 9.4.1212.jre7
当应用程序实际上无法打开与我尝试连接的 AppEngine 上的 postgres 实例的 jdbc 连接时,这最终会导致很多调试问题。这听起来与this issue 中描述的问题相同,因为该postgres 版本是Spring Boot dependencies BOM 中定义的。
我最终通过将compile 'org.postgresql:postgresql:42.2.2' 直接添加到我的应用程序的build.gradle 文件中来解决这个问题...但我想更好地理解为什么Spring Boot 仅在作为我的依赖项引入时才降级该版本图书馆。
【问题讨论】:
标签: spring-boot