[Spring Boot] SpringApplication

inยท2023๋…„ 9์›” 11์ผ
0

Spring

๋ชฉ๋ก ๋ณด๊ธฐ
3/7
@SpringBootApplication
public class Application {

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

}

๐Ÿ“Œ @SpringBootApplication

  • ์–ด๋…ธํ…Œ์ด์…˜์„ ํ†ตํ•ด ์Šคํ”„๋ง Bean์„ ์ฝ์–ด์™€ ์ž๋™์œผ๋กœ ์ƒ์„ฑ
  • ์ด ์–ด๋…ธํ…Œ์ด์…˜์ด ์žˆ๋Š” ํŒŒ์ผ ์œ„์น˜๋ถ€ํ„ฐ ์„ค์ •๋“ค์„ ์ฝ์–ด๋“ค์–ด๊ฐ€๋ฏ€๋กœ ํ•ญ์ƒ ํ”„๋กœ์ ํŠธ ์ƒ๋‹จ์— ์œ„์น˜ํ•ด์•ผํ•จ

๋‚ด๋ถ€์  ๊ธฐ๋Šฅ

โœ”๏ธ @EnableAutoConfiguration
Spring Boot์˜ ์ž๋™ ๊ตฌ์„ฑ ๋ฉ”์ปค๋‹ˆ์ฆ˜ ํ™œ์„ฑํ™”

โœ”๏ธ @ComponentScan
์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋‚ด์˜ ํŒจํ‚ค์ง€์—์„œ @Component ์–ด๋…ธํ…Œ์ด์…˜์ด ๋ถ™์€ ํด๋ž˜์Šค๋“ค์— ๋Œ€ํ•œ ์Šค์บ๋‹ ํ™œ์„ฑํ™”

โœ”๏ธ @SpringBootConfiguration
Spring Context์— Bean์„ ์ถ”๊ฐ€์ ์œผ๋กœ ๋“ฑ๋กํ•˜๊ฑฐ๋‚˜ COnfiguration ํด๋ž˜์Šค๋ฅผ ์ถ”๊ฐ€์ ์œผ๋กœ importํ•˜๋Š” ๊ธฐ๋Šฅ ํ™œ์„ฑํ™”

๐Ÿ“Œ SpringApplication.run()

  • run()์œผ๋กœ ํ•ด๋‹น ํด๋ž˜์Šค๋ฅผ runํ•˜๋ฉด ๋‚ด์žฅ WAS๋ฅผ ์‹คํ–‰
  • ๋‚ด์žฅ WAS๋Š” ๊ฐœ๋ฐœ์ž๊ฐ€ ๋”ฐ๋กœ ํ†ฐ์บฃ๊ณผ ๊ฐ™์€ ์™ธ๋ถ€ WAS๋ฅผ ์„ค์น˜ ํ›„ ์„ค์ •ํ•ด๋‘์ง€ ์•Š์•„๋„ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์‹คํ–‰ ๊ฐ€๋Šฅ

[์ฐธ๊ณ  ์ž๋ฃŒ]

๐Ÿ”—๋งํฌ
๐Ÿ”—๋งํฌ

0๊ฐœ์˜ ๋Œ“๊ธ€

Powered by GraphCDN, the GraphQL CDN