dyc87112 / spring-cloud-config-admin

Spring Cloud Config的综合管理后台(简称:SCCA)
https://dyc87112.github.io/spring-cloud-config-admin-doc/
Apache License 2.0
658 stars 262 forks source link

加载git配置文件中的username时,被system用户的username覆盖了 #107

Open innerpeacez opened 6 years ago

innerpeacez commented 6 years ago

spring注入bean的时候,获取了系统环境(SystemEnvironment)覆盖了从配置文件中读取到的git的username。我这边是修改了(SccaGitProperties类中的的字段名)。 tim 20180919170325

dyc87112 commented 6 years ago

系统环境怎么配置会覆盖这里啊?

innerpeacez commented 6 years ago

是的,我debug进去看了,系统的用户名覆盖了,系统用户名字段也是username

innerpeacez commented 6 years ago

这个我还有点疑惑,两台电脑,一台电脑遇到了,一台没有遇到这个问题

dyc87112 commented 6 years ago

可以看看出问题的那台环境变量是怎么配置的吗?

innerpeacez commented 6 years ago

image

配置了一个USERNAME

clickear commented 5 years ago

image 这是由于在 scca-plugin-git项目中,对SccaGitProperties 即使用了 @Value 和 @ConfigurationProperties。跟踪发现,首次加载时,有进入正确的值。但生成bean注入到容器中时,由于 @ConfigurationProperties 是松散语法,匹配到了 username这个变量。 image 应该是用法不对导致的。 将 SccaPluginGitConfiguration 修改为 @Import(SccaGitProperties.class) 可正常使用。

leiWJ commented 5 years ago

git方式部署在阿里服务上,一直在pending,i然后报错504,是因为username 的原因吗