不论是用@Configuration还是@Component都报错
类:
@Component
@ConfigurationProperties(prefix = "com.example.opensource")
@PropertySource(value = "classpath:resource.properties")
public class Resource {
private String name;
private String website;
private String language;
错误描述
Description:
Field resource in com.example.controller.HelloController required a bean of type 'com.example.pojo.Resource' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.example.pojo.Resource' in your configuration.