解决spring-boot-configuration-processor导入之后,任没有提示问题
程序员文章站
2022-03-19 16:04:29
解决spring-boot-configuration-processor导入之后,任没有提示问题在检查之后得出:idea在导入spring-boot-configuration-processor依赖之后,任然没有提示,在检查pom文件以及自己代码之后发现并没有问题 org.springframework.boot spring-boo...
解决spring-boot-configuration-processor导入之后,任没有提示问题
idea在导入spring-boot-configuration-processor依赖之后,任然没有提示,在检查pom文件以及自己代码之后发现并没有问题
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
检查注解 @ConfigurationProperties也已经使用
@Component
@ConfigurationProperties
public class Student {
private Integer stuId;
private String stuName;
private Boolean graduated;
private String[] subject;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date birthday;
private Map<String, String> teachers;
private Address address;
public Student() {
}
public Student(Integer stuId, String stuName, Boolean graduated, String[] subject, Date birthday, Map<String, String> teachers, Address address) {
this.stuId = stuId;
this.stuName = stuName;
this.graduated = graduated;
this.subject = subject;
this.birthday = birthday;
this.teachers = teachers;
this.address = address;
}
public Integer getStuId() {
return stuId;
}
public void setStuId(Integer stuId) {
this.stuId = stuId;
}
public String getStuName() {
return stuName;
}
public void setStuName(String stuName) {
this.stuName = stuName;
}
public Boolean getGraduated() {
return graduated;
}
public void setGraduated(Boolean graduated) {
this.graduated = graduated;
}
public String[] getSubject() {
return subject;
}
public void setSubject(String[] subject) {
this.subject = subject;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public Map<String, String> getTeachers() {
return teachers;
}
public void setTeachers(Map<String, String> teachers) {
this.teachers = teachers;
}
public Address getAddress() {
return address;
}
public void setAddress(Address address) {
this.address = address;
}
@Override
public String toString() {
return "Student{" +
"stuId=" + stuId +
", stuName='" + stuName + '\'' +
", graduated=" + graduated +
", subject=" + Arrays.toString(subject) +
", birthday=" + birthday +
", teachers=" + teachers +
", address=" + address +
'}';
}
}
在检查之后得出:
导完所有依赖之后刷新maven工程,还有重要的一步,将工程重新build
问题解决:
本文地址:https://blog.csdn.net/pleading/article/details/111861045