【发布时间】:2019-07-21 08:24:12
【问题描述】:
你好,我有一个带有这个 application.yml 的 micronaut 应用程序
micronaut:
application:
name: hello-world
pref:
msg: Luca
在一个类中我想设置一个变量的值:
@Value("${pref.msg}")
private lateinit var text : String
但 IDE 抱怨说注解参数必须是编译时常量
我也试过
@Property(name = "pref.msg" )
但它编译但不读取属性。
有人可以帮忙吗?
【问题讨论】: