例如,文件DataSourceConfig.java
package com.apress.demo;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "jdbc")
public class DataSourceConfig {
private String driver;
private String url;
private String username;
private String password;
@Override
public String toString() {
return "DataSourceConfig [driver=" + driver + ", url=" + url + ", username=" + username + "]";
}
public String getDriver() {
return driver;
}
public void setDriver(String driver) {
this.driver = driver;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
这通知怎么办?
1条答案
按热度按时间owfi6suc1#
它只是提醒您,在您进行更改并重新运行注记处理器之前,配置属性将不可用
您可以通过以下方式在IntelliJ中启用注解处理器:
或
在pom.xml中添加依赖项
配置注解处理器并添加注解
@Configuration