Java 如何在Spring Boot Eureka配置中提供外部.yml文件?
我有多模块Spring启动应用程序。对于UserManager模块,我在参考资料部分有userman.yml、userman-development.yml和bootsrap.yml。但是,我无法访问userman-dev.yml。我在userman-development.yml中设置了数据库url,因为它没有看到我得到的userman-development.yml 我犯了一个错误 这是 BootStrap.yml userman-development.yml 如何解决这个问题?这部分我缺少什么?我的逻辑正确吗Java 如何在Spring Boot Eureka配置中提供外部.yml文件?,java,spring,spring-boot,spring-boot-jpa,Java,Spring,Spring Boot,Spring Boot Jpa,我有多模块Spring启动应用程序。对于UserManager模块,我在参考资料部分有userman.yml、userman-development.yml和bootsrap.yml。但是,我无法访问userman-dev.yml。我在userman-development.yml中设置了数据库url,因为它没有看到我得到的userman-development.yml 我犯了一个错误 这是 BootStrap.yml userman-development.yml 如何解决这个问题?这部分我缺
谢谢。
配置文件开发当前处于活动状态
-通常,活动配置文件开发
将插入如下内容:应用程序-{ENV}.yaml
-因此您可能需要应用程序开发.yaml
或将配置文件名称更新为dev配置文件开发当前处于活动状态
-通常,活动配置文件开发
将插入如下内容:应用程序-{ENV}.yaml
-因此您可能需要应用程序开发.yaml
或将配置文件名称更新为dev
你好,Rob,谢谢您的回复,但仍然是一样的。从bootstrap.yml调用userman开发的正确方法是什么?我是说正确的方法是什么?我假设它没有看到userman-development.yml.sorry-看起来这个问题与我最初阅读它时有所不同。我可以告诉你哪一个可能会有帮助。。。第1.1-1.3节看起来很相关你好,罗布,谢谢你的回复,但还是一样。从bootstrap.yml调用userman开发的正确方法是什么?我是说正确的方法是什么?我假设它没有看到userman-development.yml.sorry-看起来这个问题与我最初阅读它时有所不同。我可以告诉你哪一个可能会有帮助。。。第1.1-1.3节看起来相关spring.application.name
设置为usermanager
,那么该文件不应该称为usermanager development.yml
?spring.application.name
设置为usermanager
,那么该文件不应该称为usermanager development.yml
?
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (the profiles development are currently active).
eureka:
instance:
leaseRenewalIntervalInSeconds: 3
leaseExpirationDurationInSeconds: 4
client:
registryFetchIntervalSeconds: 1
initialInstanceInfoReplicationIntervalSeconds: 4
flyway:
enabled: false
spring:
application:
name: usermanager
tomcat-timeout-minutes: 3
cloud:
config:
uri: ${vcap.services.eureka-service.credentials.uri:http://127.0.0.1:8761}/config
failFast: true
retry:
initialInterval: 2000
multiplier: 1.5
maxInterval: 4000
maxAttempts: 30
server:
port: 9100
endpoints:
info:
enabled: true
spring:
datasource:
url: "jdbc:postgresql://localhost/`BUSDRIVERS"
username: postgres
password: 1
logging:
level:
com.iozer.example: DEBUG
com.netflix.discovery.TimedSupervisorTask: "OFF"
dev:
adminEnabled: true