Gradle 使用@Value注册编译报错

报错信息:Expected '$(student - name)' to be an inline constant of type java.lang.String in @org.springframework.beans.factory.annotation.Value

这样使用会报错,原因是 Gradle和Springboot占位符冲突;解决方法就是将$符号转义以下即可

@Value("\${student-name}")
private String fooBar;



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章