@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
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.*
로 구성한다. HikariCP 등 다른 구현체를 사용할 수도 있다.spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/
이 프라퍼티에 의해 결정됨. 기본값 참고.public/
디렉토리WebMvcConfigurerAdapter.addResourceHandlers
오버라이드하여 직접 지정@Configuration public class StaticResourceConfig extends WebMvcConfigurerAdapter { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/static/**") .addResourceLocations("file:/var/www/html"); } }
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