Spring boot Spring引导和GCP:没有类型为org.springframework.cloud.GCP.secretmanager.SecretManagerTemplate的合格bean

Spring boot Spring引导和GCP:没有类型为org.springframework.cloud.GCP.secretmanager.SecretManagerTemplate的合格bean,spring-boot,google-cloud-platform,spring-cloud-gcp,google-secret-manager,Spring Boot,Google Cloud Platform,Spring Cloud Gcp,Google Secret Manager,连接到GCP以从机密管理器获取机密时出错,但不知怎的,它对我不起作用 以以下方式运行应用程序时出错: 没有类型为org.springframework.cloud.gcp.secretmanager.SecretManagerTemplate的合格bean 我正在使用SecretManagerTemplate获取机密,如下所示: secretManagerTemplate.getSecretString(keyName); 详情: Spring启动版本:2.1.8 SpringCloud版本

连接到GCP以从机密管理器获取机密时出错,但不知怎的,它对我不起作用

以以下方式运行应用程序时出错:

没有类型为org.springframework.cloud.gcp.secretmanager.SecretManagerTemplate的合格bean

我正在使用SecretManagerTemplate获取机密,如下所示:

secretManagerTemplate.getSecretString(keyName);
详情:

  • Spring启动版本:2.1.8
  • SpringCloud版本:Greenwich.RELEASE
  • Spring Cloud GCP 1.2.5.0版发布
注意:我不想升级Spring启动版本


请提供帮助。

您是否遵循了组件配置所需的所有步骤?基本上,您需要定义正确的项目依赖项:
org.springframework.cloud-spring-cloud-gcp-starter-secretmanager
。控制台是否打印任何错误?谢谢@jccampanero的评论,是的,我已经添加了步骤中提到的所有必需依赖项。我得到的错误与在自动连线的情况下没有此SecretManagerTemplate类型的合格bean相同。只是为了更新,如果我升级到2.3.1或更高版本,它工作正常,但在最新版本中,我们确实存在一些Spring启动内存问题,因此无法升级我们的应用程序。感谢您的澄清@AshishMalhotra