码迷,mamicode.com
首页 > 其他好文 > 详细

Gradle 使用@Value注册编译报错

时间:2021-05-24 00:03:03      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:解决方法   ota   exp   gradle   oob   beans   使用   ant   const   

报错信息: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;



Gradle 使用@Value注册编译报错

标签:解决方法   ota   exp   gradle   oob   beans   使用   ant   const   

原文地址:https://www.cnblogs.com/XingXiaoMeng/p/14729107.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!