JAVA:在使用springboot构建项目时,Mapper下面的接口无法注入容器

参考:https://stackoverflow.com/questions/54731705/mybatiss-mapper-interface-cannot-be-injected-by-autowired

SpringBoot有个启动文件:

package com.hello;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

}

默认的扫描路径是当前包。

你可能感兴趣的:(Java)