μ€νλ§ λΆνΈλ μλ²κ° μλλ€.
μΉ μλ²κ° μλ ννλ‘ μ€ννλ λ²
λ°©λ² 1
μ€νλ§λΆνΈ νλ‘μ νΈμμ main λ©μλμ μλμ κ°μ΄ μμ±νλ©΄ λλ€.
SpringApplication application = new SpringApplication(Application.class);
application.setWebApplicationType(WebApplicationType.NONE);
application.run(args);
νλ©΄ μΉ μλ²κ° μλ ννλ‘ μ€νν μ μλ€.
λ°©λ² 2
λλ main λ©μλλ μλλλ‘ λκ³ resources > application.properties νμΌμ μλμ κ°μ΄ μμ±ν΄λ³΄μ
spring.main.web-application.type=none
"ν°μΊ£ κ°μ²΄ μμ±ν΄μ ν¬νΈλ²νΈ μ€μ νκ³ μ»¨ν μ€νΈλ₯Ό μΆκ°νκ³ , μλΈλ¦Ώμ λ§λ€μ΄ ν°μΊ£μ μΆκ°νκ³ , 컨ν μ€νΈμ μλΈλ¦Ώ 맡νν΄μ ν°μΊ£μ μ€ν λ° λκΈ°μν€λ" λͺ¨λ κ³Όμ μ λ³΄λ€ μμΈν λ μ μ°νκ³ μ€μ νκ³ μ€νν΄μ£Όλκ² λ°λ‘ μ€νλ§ λΆνΈμ μλ μ€μ μ΄λ€.
1.
ServletWebServerFactoryAutoConfigurationμμ μλΈλ¦Ώ 컨ν μ΄λμ μΉ μλ² μμ±νλ€.
TomcatServletWebServerFactoryCustomizer μ ν΅ν΄ ν°μΊ£μλ²λ₯Ό 컀μ€ν°λ§μ΄μ§νλ€.
2.
DispatcherServletAutoConfigurationλ
HttpServletμ μμν΄μ λ§λ Spring mvcμ ν΅μ¬ν΄λμ€μΈ DispatcherServletμ λ§λ€κ³ μλΈλ¦Ώ 컨ν μ΄λμ λ±λ‘νλ μΌμ νλ€.
*
μ νμΌλ€μ μ§μ λ€μ΄κ°λ³΄κ³ μΆλ€λ©΄
Maven:org.springframework.boot.spring-boot-autoconfigure:λ²μ > META-INF > spirng.factoriesμμ
μ΄λ¦λ€μ ν΄λ¦νλ©΄ λ€μ΄κ° μ μλ€.
'Springboot' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
μ€νλ§λΆνΈ, λ 립μ μΌλ‘ μ€ν κ°λ₯ν JAR (0) | 2021.01.06 |
---|---|
μ€νλ§ λΆνΈ ν¬νΈ λ²νΈ λ³κ²½, λλ€ν¬νΈ, ν¬νΈ λ²νΈ νμΈνκΈ° (0) | 2021.01.05 |
μ€νλ§ λΆνΈμ λ΄μ₯λ tomcat μλ² λ³κ²½νλ λ² (0) | 2021.01.05 |
μ€νλ§ λΆνΈμ Auto Configuration μ§μ ꡬνν΄λ³΄κΈ° (0) | 2021.01.05 |
μ€νλ§ λΆνΈ μλμ€μ κ°λ¨νκ² μ΄ν΄νκΈ° (0) | 2021.01.05 |
Springboot μμ‘΄μ± κ΄λ¦¬μ λνμ¬ (0) | 2021.01.05 |