Using Spring Boot —— Structuring Your Code

 

1. Use the default package.

  Do not scan the next class in the default package

 

2. Main Application Class

  Use SpringBootApplication annotation, which contains the following three notes:

  

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);
    }

}

 

Guess you like

Origin www.cnblogs.com/han6/p/11505495.html
Recommended