Configuration using annotation @SpringBootApplication

前端 未结 5 1836
挽巷
挽巷 2020-11-27 18:15

I have problem with Spring Boot configuration.

I have created base Spring Boot project using https://start.spring.io/

And I have a problem, configuration wor

5条回答
  •  野性不改
    2020-11-27 19:03

    For the scanning of packages to really work, you must do as follows.

    @SpringBootApplication(scanBasePackages = {"com.your.package.test.*.*"})
    

    The first asterisk tells you to scan all packages within the main path (com.your.package.test) and the second asterisk tells you to scan all files in each package.

    For example:

    com.your.package.test
    |_ config
    |_ business
    |_ controller
    |_ domain
    |_ repository
    

提交回复
热议问题