1 package com.demo.example.demo; 2 3 import org.springframework.boot.SpringApplication; 4 import org.springframework.boot.autoconfigure.SpringBootApplication; 5 import org.springframework.context.annotation.ComponentScan; 6 7 @SpringBootApplication 8 @ComponentScan(basePackages = {"com.demo.controller"}) 9 public class Demo1Application { 10 11 public static void main(String[] args) { 12 SpringApplication.run(Demo1Application.class, args); 13 } 14 }
1 package com.demo; 2 3 import org.springframework.boot.SpringApplication; 4 import org.springframework.boot.autoconfigure.SpringBootApplication; 5 import org.springframework.context.annotation.ComponentScan; 6 7 @SpringBootApplication 8 public class Demo1Application { 9 10 public static void main(String[] args) { 11 SpringApplication.run(Demo1Application.class, args); 12 } 13 }