标签:service doc autoconf stat rgs 问题 eth with bsp
@ComponentScan
, @EntityScan
, or @SpringBootApplication
可能会有问题。@SpringBootApplication
annotation is often placed on your main class, and it implicitly defines a base “search package” for certain items. For example, if you are writing a JPA application, the package of the @SpringBootApplication
annotated class is used to search for @Entity
items. Using a root package also allows component scan to apply only on your project.com +- example +- myapplication +- Application.java | +- customer | +- Customer.java | +- CustomerController.java | +- CustomerService.java | +- CustomerRepository.java | +- order +- Order.java +- OrderController.java +- OrderService.java +- OrderRepository.java
Application.java
file would declare the main
method, along with the basic @SpringBootApplication
, as follows:package com.example.myapplication; 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); } }
Spring boot 梳理 - 代码结构(Main类的位置)
标签:service doc autoconf stat rgs 问题 eth with bsp
原文地址:https://www.cnblogs.com/jiangtao1218/p/10159349.html