====== SpringBoot ======
* [[http://projects.spring.io/spring-boot/|Spring Boot]]
* [[http://start.spring.io/|Spring Initializr]]
* [[http://www.baeldung.com/spring-boot|Learn Spring Boot | Baeldung]]
* [[springframework:springboot:devtools|SpringBoot DevTools]]
* [[springframework:springboot:properties|SpringBoot Properties]]
* [[springframework:springboot:jpa|Spring Boot And JPA]]
* [[springframework:springboot:mvc|SpringBoot and Spring MVC]]
* [[springframework:springboot:json|SpringBoot and JSON]]
* [[springframework:springboot:batch|SpringBoot와 SpringBatch]]
* [[springframework:springboot:springboot_admin|SpringBoot Admin]]
* [[springframework:springboot:gradle|SpringBoot and Gradle]]
* [[springframework:springboot:test|SpringBoot Test]]
* [[springframework:springboot:springboot_cli|SpringBoot CLI]]
* [[springframework:springboot:startup|SpringBoot startup 최적화 / optimization]]
* [[https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-dependency-versions.html|Dependency versions]] 여기서 의존 라이브러리 버전과 프라퍼티명 확인
===== @EnableAutoConfiguration =====
* [[https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/autoconfigure/EnableAutoConfiguration.html|@EnableAutoConfiguration]]
* 특정 Auto Configuration 방지
@EnableAutoConfiguration(exclude = {
DataSourceAutoConfiguration.class,
DataSourceTransactionManagerAutoConfiguration.class,
HibernateJpaAutoConfiguration.class})
* [[https://www.baeldung.com/spring-boot-custom-auto-configuration|A Custom Auto-Configuration with Spring Boot | Baeldung]]
===== JRebel SpringBoot / Gradle =====
* [[https://www.javacodegeeks.com/2018/02/jrebel-gradle-spring-boot-app.html|JRebel for a Gradle Spring Boot App | Java Code Geeks - 2018]]
===== DataSource =====
* Default 말고 직접 ''DataSource'' 설정을 하고자 할경우에는 다음과 같이 한다.
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
@Bean
@ConfigurationProperties(prefix = "my.datasource")
public DataSource rubyDataSource() {
return DataSourceBuilder.create().type(org.apache.tomcat.jdbc.pool.DataSource.class).build();
}
* 위 예에서 설정값은 ''my.datasource.*''로 구성한다. [[java:database:hikaricp|HikariCP]] 등 다른 구현체를 사용할 수도 있다.
==== SpringApplicationRunListener ====
* [[https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/SpringApplicationRunListener.html|SpringApplicationRunListener]]
* SpringBoot 로딩중 이벤트를 받아 처리한다.
===== SpringBoot WebMVC 정적 리소스(static resource) =====
==== static resource 서빙 경로 ====
* ''spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/'' 이 프라퍼티에 의해 결정됨. 기본값 참고.
* jar 애플리케이션을 실행한 디렉토리 하위의 ''public/'' 디렉토리
* ''WebMvcConfigurerAdapter.addResourceHandlers'' 오버라이드하여 직접 지정
@Configuration
public class StaticResourceConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**")
.addResourceLocations("file:/var/www/html");
}
}
==== static resource 관련 프라퍼티 ====
* [[https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html|Appendix A. Common application properties]] 에서 ''spring.mvc.*'' 와 ''spring.resources.*'' 참조
spring.mvc.static-path-pattern=/** # 정적 resource url 패턴
server.compression.enabled=true
spring.resources.chain.cache=true
server.compression.min-response-size=2048
spring.resources.chain.enabled=true
spring.resources.cache-period=3600
===== 참고 =====
* [[http://andromedarabbit.net/wp/spring-boot%ec%97%90%ec%84%9c-spring-framework-%eb%b2%84%ec%a0%84-%ec%a7%80%ec%a0%95%ed%95%98%ea%b8%b0/|Spring Boot에서 Spring Framework 버전 지정하기]]
* [[http://www.infoq.com/presentations/spring-boot-devops|Spring Boot for DevOps]]
* [[https://examples.javacodegeeks.com/enterprise-java/spring/boot/spring-boot-tutorial-beginners/|Spring Boot Tutorial for beginners]]
* [[https://examples.javacodegeeks.com/enterprise-java/spring/boot/spring-boot-configuration-tutorial/|Spring Boot Configuration Tutorial]]
* [[http://jojoldu.tistory.com/226|SpringBoot @MockBean, @SpyBean 소개]]
* [[http://www.baeldung.com/spring-boot-shutdown|Shutdown a Spring Boot Application | Baeldung]]
* [[http://www.baeldung.com/spring-boot-thin-jar|Thin JARs with Spring Boot | Baeldung]]
* [[https://dzone.com/articles/graceful-shutdown-spring-boot-applications|Graceful Shutdown Spring Boot Applications - DZone Java]]
* [[https://www.sourcecodeexamples.net/p/free-spring-boot-projects.html|무료 SpringBoot 예제 모음]]
* [[https://www.javaguides.net/p/spring-boot-tutorial.html|Spring Boot Tutorial]]