使用@ConfigurationProperties注解 提示 “Spring Boot Configuration Annotation Processor not found in classpath ”


解決方案:

在 pom.xml 添加依賴

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

 

添加后,提示就沒有了,假設你添加 spring-boot-configuration-processor 依賴 出現了這個提示

 

因為依賴沒放版本這個選項,所以它默認是最新的版本,把版本降低一下,依賴就可以下載了。

 

        <!-- 配置文件自動映射 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <version>2.1.6.RELEASE</version>
            <optional>true</optional>
        </dependency>

 

 

 

最后記得 Build 一下項目。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM