天天看點

spring boot configuration annotation processor notfound in classpath

spring boot configuration annotation processor notfound in classpath

最近研究Spring Boot,在擷取配置檔案的時候一直提示,spring引導配置注釋處理器在類路徑中找不到,雖然不影響代碼的運作以及擷取,但是這樣提示肯定是有問題的。

在spring boot原本的@ConfigurationProperties注解中是有location屬性的,1.5版本就将此屬性移除了,是以導緻無法正常給配置類的屬性指派,通過在spring boot 官網查詢到隻要在pom檔案中添加一個依賴即可

<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-configuration-processor</artifactId>
			<optional>true</optional>
		</dependency>           

重新編譯一下

繼續閱讀