I'm trying to generate spring-configuration-metadata.json file for my Spring Boot based project. If I use Java @ConfigurationProperties class it is generated correctly and automatically:
@ConfigurationProperties("myprops")
public class MyProps {
private String hello;
public String getHello() {
return hello;
}
public void setHello(String hello) {
this.hello = hello;
}
}
但如果我使用Kotlin类,则不会生成spring-configuration-metadata.json文件(我try 了gradle build和Idea Rebuild Project).
@ConfigurationProperties("myprops")
class MyProps {
var hello: String? = null
}
AFAIK Kotlin使用构造函数、getter和setter生成同一个类,应该充当常规的Java bean.
Any ideas why spring-boot-configuration-processor doesn't work with Kotlin classes?