SpringCloud啓動類指定掃描包路徑

 

//若是這個啓動類所在的包路徑隱藏的很深,則須要指定掃描包。不然默認掃描啓動類所在的子包路徑下
@SpringBootApplication(scanBasePackages="com.joyce.users")
public class MyApplication{
    
    public static void main(String[] args){
          SpringApplication.run(MyApplication.class,args);  
    }  
}
相關文章
相關標籤/搜索