我已经使用Spring cloud config配置了应用程序,我想通过jvm Agrument运行此应用程序:
bootsrap.yml配置
spring.application.name: app
spring.cloud.config:
enabled: ${SPRING_CONFIG_ENABLED:false}
uri: ${SPRING_CONFIG_URI:http://ip:9097/}
我想像这样传递参数,但不起作用:
gradle bootRunLocal -DSPRING_CONFIG_ENABLED=true -DSPRING_CONFIG_URI=http://localhost:9097/
最佳答案
尝试将build.gradle文件中的bootrun任务配置为以下内容:
bootRun {
systemProperties System.properties
}
关于java - Spring Cloud Pass参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61706266/