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;



复制请注明出处,在世界中挣扎的灰太狼
原文地址:https://www.cnblogs.com/XingXiaoMeng/p/14729107.html