문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
springframework:springboot [2018/11/19 15:47] kwon37xi |
springframework:springboot [2022/10/26 10:14] (현재) kwon37xi |
||
|---|---|---|---|
| 줄 10: | 줄 10: | ||
| * [[springframework: | * [[springframework: | ||
| * [[springframework: | * [[springframework: | ||
| + | * [[springframework: | ||
| + | * [[springframework: | ||
| + | * [[springframework: | ||
| + | * [[springframework: | ||
| + | * [[https:// | ||
| ===== @EnableAutoConfiguration ===== | ===== @EnableAutoConfiguration ===== | ||
| 줄 20: | 줄 25: | ||
| </ | </ | ||
| * [[https:// | * [[https:// | ||
| - | ===== Dependency Version Override ===== | ||
| - | 의존 라이브러리의 버전을 다른 것으로 바꾸고자 한다면 property를 변경하면 된다. | ||
| - | <code groovy> | ||
| - | // 하이버네이트 버전 | ||
| - | ext[' | ||
| - | </ | ||
| - | |||
| - | * [[https:// | ||
| ===== JRebel SpringBoot / Gradle ===== | ===== JRebel SpringBoot / Gradle ===== | ||
| * [[https:// | * [[https:// | ||
| - | |||
| - | |||
| ===== DataSource ===== | ===== DataSource ===== | ||
| 줄 46: | 줄 41: | ||
| * 위 예에서 설정값은 '' | * 위 예에서 설정값은 '' | ||
| - | ===== BootRun ===== | + | ==== SpringApplicationRunListener |
| - | ==== Debug Mode ==== | + | |
| - | <code groovy> | + | * SpringBoot |
| - | bootRun { | + | |
| - | if (project.hasProperty(" | + | |
| - | jvmArgs = [" | + | |
| - | } | + | |
| - | } | + | |
| - | + | ||
| - | // suspend=y는 JVM이 뜰 때 Remote Debugger가 접속될 때까지 기다린다. | + | |
| - | // 실행 후 바로 종료하는 명령행 애플리케이션의 경우 무조건 y | + | |
| - | </ | + | |
| - | + | ||
| - | <code sh> | + | |
| - | # -PbootDebug 프라퍼티를 지정하면 디버그 모드로 뜬다. | + | |
| - | ./gradlew bootRun -PbootDebug | + | |
| - | </ | + | |
| - | ==== Application Arguments | + | ===== SpringBoot WebMVC 정적 리소스(static resource) ===== |
| - | * [[https://www.baeldung.com/spring-boot-command-line-arguments|Command-line Arguments in Spring Boot | Baeldung]] | + | ==== static resource 서빙 경로 |
| - | < | + | * '' |
| - | bootRun | + | * jar 애플리케이션을 실행한 디렉토리 하위의 '' |
| - | | + | * '' |
| - | | + | @Configuration |
| + | public class StaticResourceConfig extends WebMvcConfigurerAdapter | ||
| + | | ||
| + | public void addResourceHandlers(ResourceHandlerRegistry registry) { | ||
| + | | ||
| + | | ||
| } | } | ||
| } | } | ||
| </ | </ | ||
| - | 위와 같이 설정하고, | + | ==== static resource 관련 프라퍼티 ==== |
| + | * [[https:// | ||
| + | < | ||
| + | spring.mvc.static-path-pattern=/ | ||
| - | <code sh> | + | server.compression.enabled=true |
| - | ./gradlew bootRun | + | spring.resources.chain.cache=true |
| + | server.compression.min-response-size=2048 | ||
| + | spring.resources.chain.enabled=true | ||
| + | spring.resources.cache-period=3600 | ||
| </ | </ | ||
| - | ==== SpringApplicationRunListener ==== | ||
| - | * [[https:// | ||
| - | * SpringBoot 로딩중 이벤트를 받아 처리한다. | ||
| ===== 참고 ===== | ===== 참고 ===== | ||
| 줄 93: | 줄 82: | ||
| * [[http:// | * [[http:// | ||
| * [[https:// | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||