반응형

스프링 부트 1.5 릴리즈 노트

원문: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.5-Release-Notes

스프링 부트 1.4에서 업그레이드된 것

스프링부트 1.4이후 디프리케이트된것들

스프링부트 1.4에서 디프리케이트된 클래스, 메소드 그리고 프로퍼티들이 이번 릴리즈에서 제거되었다. 업그레이드전 디프리케이트된 메소드를 호출하는지 확인하자. 특히 HornetQ와 벨로시티 Velocity서포트가 삭제되었다.


이름이 바뀐 스타터들

스프링부트 1.4에서 이름이 바뀐 다음의 스타터들이 이번에 삭제되었다. 만일 "해결할수 없는 의존성 Unresolved dependency" 에러가 뜬다면 사용중인 스타터 이름이 올바른지 확인해보자:

  • spring-boot-starter-ws → spring-boot-starter-web-services

  • spring-boot-starter-redis → spring-boot-starter-data-redis

@ConfigurationProperties validation

JSR-303 규약 어노테이션을 사용하는 @ConfigurationProperties 클래스를 가지고 있다면 이제 그것들에 추가적으로 @Validated 어노테이션을 해줘야한다. 이미 있는 유효성은 여전히 잘 동작할것이지만 로그에 warning이 뜬것이다. 머지않아 @Validated 이 없는 클래스는 사용할 수 없을 것이다. 

스프링 세션 저장 Spring Session store

이제껏 스프링 세션과 레디스를 특별한 설정없이 사용해왔다면, 레디스는 자동으로 세션을 저장하는데 사용되었다. 이제는 저장 타입을 명시해주어야한다. 레디스와 스프링 세션을 사용하는 사용자들은 다음의 설정을 추가 해주어야한다:

spring.session.store-type=redis

액츄에이터 보안 Actuator security

Actuator "sensitive" endpoints are now secure by default (even if don’t have a dependency on "Spring Security"). If your existing Spring Boot 1.4 application makes use of Spring Security (and doesn’t have any custom security configuration) things should work as before. If your existing Spring Boot 1.4 application has custom security configuration and you wish to have open access to your sensitive endpoints, you will need to explicitly configure that in your security configuration. If you’re upgrading a Spring Boot 1.4 application that doesn’t have dependency on Spring Security and you wish to retain open access to your sensitive endpoints you’ll need to set management.security.enabled to false. See the updated reference documentation for more details.

The default role required to access the endpoints has also changed from ADMIN to ACTUATOR. This is to prevent accidental exposure of endpoints if you happen to use the ADMIN role for other purposes. If you want to restore Spring Boot 1.4 behavior set the management.security.roles property to ADMIN.

인메모리 매트릭스 리파지토리 InMemoryMetricRepository

InMemoryMetricRepository는 더이상 직접적으로 MultiMetricRepository를 구현하지않는다.  정식 InMemoryMetricRepository에 의해 뒷받침되어 MultiMetricRepository 인터페이스를 만족시키는 새로운 InMemoryMultiMetricRepository 빈이 이제 등록되었다. 대부분의 사용자가 MetricRepository 또는 MultiMetricRepository 인터페이스를 사용하고 있으므로 이 변화는 직접 보여지지않는다.  

spring.jpa.database

The spring.jpa.database 는 spring.datasource.url 프로퍼티를 통한 일반적인 데이터 베이스를 자동으로 찾아준다. 만일 spring.jpa.database를 수동으로 정의하며 사용해왔고 일반적인 데이터베이스를 사용하고 있다면 이 프로퍼티들을 다 없애버려도 될것이다.

하나 이상의 Dialect 를 가진 몇몇의 데이터베이스 (이를테면 Microsoft SQL Server 는 3개를 가지고있다) 그리고 당신이 사용중인 데이터베이스의 버젼이 설정한 것과 맞지 않는다면, 이전에 잘 작동한 설정을 가지고 하이버네이트의 Dialect자동 찾기에 맡기기 원한다면 spring.jpa.database=default 로 설정하자. 대안으로  spring.jpa.database-platform 프로퍼티를 사용하여 당신의 dialect를 설정할 수 있다.

@IntegrationComponentScan

스프링 Integration의 @IntegrationComponentScan 어노테이션은 이제 자동 설정된다. 권장되는 프로젝트 구조를 따른다면 당신은 이것을 지워줘야한다.

ApplicationStartedEvent

현재 당신의 코드에서 ApplicationStartedEvent를 위한 리스너 listener가 있다면,  ApplicationStartingEvent를 쓰도록 코드를 리팩토링 해주어야한다. 우리는 이 클래스가 무엇을 하는지 더 정확하게 알수 있게 이름을 바꾸었다.

Spring Integration Starter

spring-boot-starter-integration POM 은 더이상 spring-integration-jmx를 포함되지 않는다. 만일 당신이 Spring Integration JMX support가 필요하다면 spring-integration-jmx 의존성을 스스로 추가해줘어야한다.

Devtools excluded by default

메이븐과 그레들 플러그인 둘다 이제 기본적으로 "fat" jars에 spring-boot-devtools jar를 패키징 하지않는다. 당신이 devtools 원격 서포트를 사용중이라면, 이제 당신의 build.gradle 또는 pom.xml 파일에 excludeDevtools 프로퍼티를 명시적으로 설정해주어야한다.

Gradle 1.x

스프링 부트 그래들 플러그인은 이제 더이상 그래들 1.x와 그래들 2.x 초기버전과 호환되지 않는다. 그래들 2.9 이상 버전인지 확인하자.

Remote CRaSH shell

불행히도 remote SSH support을 제공하고저 스프링부트에서 사용하는 CRaSH project 는 더이상 유지가 되지않고 있으므로 우리는 remote actuator SSH support을 디프리케이트 하기로 결정하였고 스프링 부트 2.0에서 완전히 제거될 예정이다.

OAuth 2 Resource Filter

OAuth2 리소스 필터의 기본 순서가 3에서 SecurityProperties.ACCESS_OVERRIDE_ORDER - 1 로 변경되었다. 이 지점은 the actuator endpoints 바로 뒤이고 basic authentication filter chain 전이다. 이 기본값은 security.oauth2.resource.filter-order = 3 으로 설정하면 예전값으로 되돌릴 수 있다.

JSP servlet

JSP 서블릿응ㄴ 이제 더이상 기본값으로 개발모드가 아니다. 개발 모드는 DevTools을 쓸때 자동적으로 활성화 된다.  server.jsp-servlet.init-parameters.development=true.설정을 통해 명시적으로 활성화 할 수도 있다. 

Ignored paths and @EnableWebSecurity

스프링 부트 1.4 또는 이전 버전에서 Actuator는 항상 어떤 Ignored paths를 설정하여 @EnableWebSecurity의 사용을 무시해왔다. 이것은 1.5에서 바로 잡았으며  @EnableWebSecurity 를 사용하면 당신에게 완전한 제어가 가능했던 웹 보안의 자동 설정이 꺼질 것이다.

새로운 사항 및 주목할만한 점

Tip
Check the configuration changelog for a complete overview of the changes in configuration.

Third-party library upgrades

서드파티 라이브러리의 버전이 최신 버젼으로 업그레이드 되었다. 이 업데이트는 pring Data Ingalls, Jetty 9.4, JooQ 3.9, AssertJ 2.6.0, Hikari 2.5 그리고 Neo4J 2.1 이며 몇몇 메이븐 플러그인도 업그레이드 되었다.

Loggers endpoint

새로운 액츄에이터 loggers endpoint는 동작중인 어플리케이션의 로깅 레벨을 바꿀수 있게 해준다. 이는 JMX와 MVC endpoint에도 사용할수있다. 예를 들면 MVC endpoint의 로깅레벨을 바꾸려면 다음의 JSON를 /loggers/com.yourcorp.application에  post로 이슈해주면 된다:

{
  "configuredLevel": "DEBUG"
}

JMX endpoint를 사용하는 로거를 업데이트하려면  setLogLevel 를 사용하면 되는데 자세한 사항은 the updated documentation에서 확인하자.

Apache Kafka support

스프링 부트 1.5는 spring-kafka프로젝트를 통해 아파치 Kafka 자동설정을 지원한다. 손쉽게 Kafka를 사용하려면  spring-kafka 의존성과 `spring.kafka.* 어플리케이션 프로퍼티를 적절하게 설정해주면 된다.

Kafka로 부터 메세지를 받으려면 어노테이션 메소드를 쓰는게 제일 간단하다: 

@Component
public class MyBean {

    @KafkaListener(topics = "someTopic")
    public void processMessage(String content) {
        // ...
    }

}

Cloud Foundry actuator extensions

Spring Boot’s actuator module now includes additional support that is activated when you deploy to a compatible Cloud Foundry instance. The /cloudfoundryapplication path provides an alternative secured route to all NamedMvcEndpoint beans.

Cloud Foundry management UIs can make use of the endpoint to display additional actuator information. For example, Pivotal Cloud Foundry shows health information next to the application status:

apps manager

You can read more about the Cloud Foundry endpoint in the reference documentation and for and example of the kinds of things it can be used for you can read this blog post about PCF 1.9.

LDAP support

스프링 부트는 이제 어떤 표준 규약을 따르는 LDAP 서버를 자동설정해준다. 뿐만 아니라 Unbounded를 사용하여 내장 인메모리 LDAP 서버를 지원한다.

자세한 사항은 the documentation를 확인하자.

AuditEvents Endpoint Support

A new AuditEventsJmxEndpoint bean now allows you to query previously recorded AuditEvents over JMX. The MBean exposes AuditEventRepository find methods via getDataoperations. Audits are automatically recoded for authentication and authorization event and you can record your own events using the AuditEventRepository. That information is also exposed by a new /auditevents MVC endpoint.

Transaction manager properties

이제  spring.transaction.* 프로퍼티를 사용하여 PlatformTransactionManager를 자동설정해주는 다양한 aspects를 설정하는것이 가능해졌다. 현재는 "default-timeout" 과  rollback-on-commit-failure 프로퍼티가 지원된다.

JmxEndpoint interface

새로운 JmxEndpoint 인터페이스가 소개되어 당신이 액츄에이터 actuator endpoint를 JMX를 통해서만 노출되도록 개발할 수 있다. 이 인터페이스는 이미 MVC only endpoint를 제공해주는  MvcEndpoint 인터페이스와 매우 유사하다.

Vendor specific flyway migrations

You can now define flyway migration that are specific to a database vendor. To use vendor specific migrations, set the flyway.locations property as follows:

flyway.locations=db/migration/{vendor}

See this how-to for more details.

Deprecation level

It is now possible to define a deprecation level for a property in the metadata. The level can either be warning (default) or error.

Here is an example of manual metadata for a property that got moved in Spring Boot 2:

{
  "name": "server.context-parameters",
  "type": "java.util.Map<java.lang.String,java.lang.String>",
  "description": "ServletContext parameters.",
  "deprecation": {
    "level": "error",
    "replacement": "server.servlet.context-parameters"
  }
}

So far, when a deprecated property is not bound anymore, we remove the metadata altogether. This new feature allows to flag a property (server.context-parameters here) as an error. Newer versions of your favorite IDE should use that to offer assistance.

테스팅 업데이트 Testing updates

이제 @Test…​a로 시작하는 어노테이션에 의해 임포트import되던 자동설정을 제외할 수 있게 되었다. 모든 현존하는  @Test…​어노테이션들은 이제 excludeAutoConfiguration 속성값을 가지게 되었다. 또 다른 방법으로 당신의 테스트코드에 직접적으로  @ImportAutoConfiguration(exclude=…​)를 추가해줘도 된다.

스프링 부트 1.5에서 새로운 @JdbcTest 어노테이션이 소개되어 직접 JDBC과 상호연동되는 테스트를 할 수 있다.

Custom fat jar layouts

스프링 부트 메이븐과 그래들 플러그인은 이제 far jar 레이아웃을 커스터마이즈할 수 있게 지원한다. 이 기능은 스프링부트의 영역 밖에서 개발된  다음과 같은 실험적인 레이아웃을 가능하게 해준다. 더 자세한 업데이트된 문서를 참고하자

JmsTemplate customizations

이제  spring.jms.template.* 네임스페이스의 추가된 키값을 사용하여 자동설정된  JmsTemplate을 커스터마이즈 할수 있게 되었다.

Miscellaneous

  • Mockito 2.x 은 이제  @MockBean 으로 사용할 수 있다.(Mockito 1.9 와 호환가능함)

  • 내장 런쳐 스크린트는 이제 a force-stop을 지원한다. 

  • 카산드라를 위한 새로운 health check가 추가되었다.

  • 카산드라 사용자 정의 타입들이 이제 해결되었다. (스프링 데이터의 SimpleUserTypeResolver를 통해)

  • The skip 프로퍼티는 이제  스프링 부트 메이븐 플러그인  run 에서, 'stop' 그리고 'repackage` goals 에서 사용할 수 있다.

  • 복수개의 main m메소드 클래스가 있다면, 메이븐과 그래들 플러그인은 이제 자동적으로  @SpringBootApplication 어노테이션이 있는것을 실행할 것이다.

Deprecations in Spring Boot 1.5

  • TomcatEmbeddedServletContainerFactory.setTldSkip has been deprecated in favor of setTldSkipPatterns

  • ApplicationStartedEvent has been replaced by ApplicationStartingEvent

  • Several constants in LoggingApplicationListener have been replaced by versions in LogFile

  • Caching with Guava has been deprecated since Guava support will be dropped in Spring Framework 5. Upgrade to Caffeine

  • CRaSH support has been deprecated since it’s no longer actively maintained

  • Several protected methods in EndpointMBeanExporter have been deprecated following the introduction of JmxEndpoint

  • SearchStrategy.PARENTS has been replaced with SearchStrategy.ANCESTORS.

  • Apache DBCP support has been deprecated in favor of DBCP 2

  • The server.undertow.buffers-per-region property has been deprecated because it is not used (see UNDERTOW-587)

  • @AutoConfigureTestDatabase has been moved from org.springframework.boot.test.autoconfigure.orm.jpa to org.springframework.boot.test.autoconfigure.jdbc

프로퍼티 이름변경 Property Renames

  • server.max-http-post-size 프로퍼티는 특정기술 형태값으로 바뀌었다. (예를 들면, server.tomcat.max-http-post-size)

  • spring.data.neo4j.session.scope 프로퍼티는 제거되었다.


반응형

반응형

스프링 부트 1.4 릴리즈 노트 - 2017년 1월 19일

원문: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.4-Release-Notes

스프링부트 1.3이후 업그레이드된 것

스프링 부트 1.3에서 더이상 지원하지않는 것 Deprecations from Spring Boot 1.3

스프링 부트 1.3에서 디프리케이트된 클래스, 메소드, 프로퍼티들은 이번 릴리즈에서 제거되었다.업그레이드에 앞서 디프리케이트된 메소드를 호출하는지 먼저 확인해야한다.

Log4j 1 지원은 Apache EOL announcement 의거하여 제거되었다.

재명명된 스타터들 Renamed starters

다음의 스타터들의 이름이 변경되었다.기존의 이름은 스프링 부터 2.0에서 제거될 것이다.

  • spring-boot-starter-ws → spring-boot-starter-web-services

  • spring-boot-starter-redis → spring-boot-starter-data-redis

DataSourceProperties의 get 메소드들 DataSourceProperties get methods

DataSourceProperties의 몇몇 get…​ 메소드들은 다른 @ConfigurationProperties 클래스들과 더 일관성있게 바뀌었다. 만약 이전에 다음의 메드들을 코드에 직접적으로 호출했었다면 동일한 기능의 새 determine…​로 바꿔줘야한다.

  • getDriverClassName() → determineDriverClassName()

  • getUrl() → determineUrl()

  • getUsername() → determineUsername()

  • getPassword() → determineUsername()

Note
The get

 메소드는 디프리케이트 되이 않았다. 하지만 이들의 행동이 바뀌었기때문에 당신은 업그레이드할때 수동으로 확인해줘야한다.

DataSource 바인딩 DataSource binding

스프링 부트 1.4 이전에는 자동 설정된 datasource들은 spring.datasourcenamespace. In 1.4, we only bind the common settings to spring.datasource (seeDataSourceProperties) and we have defined new specific namespaces for the four connections pools we support (in that order):
alents:ethods from DataSourceProperties 프링 부트 1.2에선 logging.config 를 써서 로깅 설정파일을 커스터마이즈할 수 있었다. 파일이 존스프링 부트 1.4 이전에는 자동설정된 datasource들은 spring.datasource 네임스페이스에 바인드되었다. 1.4부터 우리는 일반적인 설정만 spring.datasource에 바인드된다(DataSourceProperties를 보자) 그리고 우리가 지원하는 4개의 커넥션풀을 위한 새로운 특정 네임스페이스 정의하였다 (순서대로):
  • org.apache.tomcat.jdbc.pool.DataSource를 위한 spring.datasource.tomcat 

  • com.zaxxer.hikari.HikariDataSource를 위한 spring.datasource.hikari

  • org.apache.commons.dbcp.BasicDataSource를 위한 spring.datasource.dbcp 

  • org.apache.commons.dbcp2.BasicDataSource를 위한 spring.datasource.dbcp2

만일 당신이 사용하는 커넥션풀의 구현물의 특정설정을 사용하고 있다면, 연관된 네임스페이스로 설정을 옮겨줘야한다. 예를 들어, 톰캣의 testOnBorrow 플래그를 사용하고 있다면, spring.datasource.test-on-borrow 에서 spring.datasource.tomcat.test-on-borrow로 옮겨줘야한다.

만일 당신이 사용하는 IDE에서 설정을 도움받았다면, spring.datasource 네임스페이스에 이들을 모두 함께 사용하지않고 커넥션 풀당 어느 설정이 사용가는한지 볼 수 있다. 이는 어느 구현체가 어느 기능을 지원하는지 알아둬야 하는 당신의 삶을 더 쉽게 만들어줄 것이다.

JTA설정 바인딩 JTA settings binding

DataSource binding과 유사하게 Atomikos와 Bitronix 를 위한 특정 JTA제공자 설정 프로퍼티가 spring.jta에 바인드 된다. 이들은 이제 spring.jta.atomikos.properties와 spring.jta.bitronix.properties에 각각 바인드 될 것이다; 이들 엔트리를 위한 메타데이터 또한 크게 향상되었다.

하이버네이트 5 Hibernate 5

하이버네이트 5는 이제 기본 JPA 퍼시스턴스 제공자로서 사용된다. 만일 스프링 부트 1.3에서 업그레이드한다면, 하이버네이트 4.3에서 5.0으로 바꿔줘야한다. 일반적인 업그레이드 방침은 Hibernate migration documentation를 참고하자. 추가적으로 당신은 다음의 것들을 알아둬야한다:

네이밍 전략 Naming Strategy

하이버네이트 5.1이 이전의 NamingStrategy 인터페이스를 지원을 삭제함으로서 SpringNamingStrategy 는 더이상 사용되지 않는다. 새로운 SpringPhysicalNamingStrategy 가 이제 자동설정되어 하이버네이트의 기본 ImplicitNamingStrategy와 함께 사용된다. 이는 스프링부트 1.3의 기본설정과 매우 유사하다 (동일하진않다). 하지만 당신은 업그레이드시 데이터베이스 스키마가 올바른지 확인해주어야 할것이다.

만일 당신이 업그레이드 전 이미 하이버네이트 5를 사용중이라면, 아마 하이버네이트5의 기본설정을 사용하고 있을 것이다. 업그레이드 후에 이를 되돌리길 원하면 당신의 설정에 이 프로퍼티를 설정하면 된다:

spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

제네레이터 매핑 Generator mappings

업그레이드의 고통을 최소화하기 위해, 우리는 하이버네이트5의 hibernate.id.new_generator_mappings을 false를로 설정해두었다. 하이버네이트 팀은 보통 이 설정을 권장하지않는다. 따라서 당신이 제네레이터 변경을 따르려면 당신의 application.properties 파일에 hibernate.id.new_generator_mappings을 true로 설정하면 된다.

하이버네이트 4.3으로 다운그레이드 Downgrading to Hibernate 4.3

하이버네이트 5.0으로 업그레이드하는데 문제가 있다면, pom.xml파일의 hibernate.version 프로퍼티를 오버라이딩함으로서 예전 버젼의 하이버네이트로 다운그레이드 할 수 있다. 

<properties>
    <hibernate.version>4.3.11.Final</hibernate.version>
</properties>

또는 그레들을 사용한다면 hibernate.version 프로퍼티를 다음과 같이 오버라이딩하면 된다:

ext['hibernate.version'] = '4.3.11.Final'
Note

하이버네이트 4.3 은 스프링부터 1.4에서 지원하지 않는다 업그레이드를 방해하는 버그가 있다면  이슈를 제기하자.


@EntityScan

@org.springframework.boot.orm.jpa.EntityScan 어노테이션은 디프리케이트 되어 @org.springframework.boot.autoconfigure.domain.EntityScan 로 변경해주거나 외부 설정을 해주어야한다.

예를 들어 만일 다음의 설정을 가지고 있다면:

import org.springframework.boot.autoconfigure.SpringApplication;
import org.springframework.boot.orm.jpa.EntityScan;

@SpringBootApplication
@EntityScan(basePackageClasses=Customer.class)
public class MyApplication {

    // ....

}

만일 자동설정된 LocalContainerEntityManagerFactoryBean을 사용중이라면 다음과 같이 바꿔준다:

import org.springframework.boot.autoconfigure.SpringApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;

@SpringBootApplication
@EntityScan(basePackageClasses=Customer.class)
public class MyApplication {

    // ....

}

또는 스스로 LocalContainerEntityManagerFactoryBean 을 설정중이라면, @EntityScan 어노테이션을 통째로 버리고 LocalContainerEntityManagerFactoryBean.setPackagesToScan(…​) 를 호출하거나 또는 EntityManagerFactoryBuilder packages(…​) 메소드를 사용해야한다:

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
            EntityManagerFactoryBuilder builder) {
    return builder
        .dataSource(...)
        .properties(...)
        .packages(Customer.class)
        .build();
}

테스트 유틸리티와 클래스들 Test utilities and classes

스프링 부트 1.4는 org.springframework.boot.test 패키지를 완전히 재구성된 새로운 spring-boot-test 모듈을 추가하였다. 스프링 부트 1.3 어플리케이션에서 업그레이드할 때, 예전 패키지들의 디프리케이트된 클래스들을 새 구조의 동일한 클래스로 바꿔주어야한다. 리눅스 또는 OSX를 쓰고있다면 다음의 커맨드를 사용해서 코드를 마이그레잇할 수 있다:

find . -type f -name '*.java' -exec sed -i '' \
-e s/org.springframework.boot.test.ConfigFileApplicationContextInitializer/org.springframework.boot.test.context.ConfigFileApplicationContextInitializer/g \
-e s/org.springframework.boot.test.EnvironmentTestUtils/org.springframework.boot.test.util.EnvironmentTestUtils/g \
-e s/org.springframework.boot.test.OutputCapture/org.springframework.boot.test.rule.OutputCapture/g \
-e s/org.springframework.boot.test.SpringApplicationContextLoader/org.springframework.boot.test.context.SpringApplicationContextLoader/g \
-e s/org.springframework.boot.test.SpringBootMockServletContext/org.springframework.boot.test.mock.web.SpringBootMockServletContext/g \
-e s/org.springframework.boot.test.TestRestTemplate/org.springframework.boot.test.web.client.TestRestTemplate/g \
{} \;

추가적으로, 스프링 부트 1.4는 스프링부트 테스트를 돌릴 수 있는 다양한 방법들을 더 합리적이고 간단하게 하려는 시도를 했다. 당신의 다음의 기존 코드를 새로운 @SpringBootTest 어노테이션을 사용하도록 바꿀수 있다:

  • 기존 @SpringApplicationConfiguration(classes=MyConfig.class) 를 대체하는 새로운 @SpringBootTest(classes=MyConfig.class)

  • 기존 @ContextConfiguration(classes=MyConfig.class, loader=SpringApplicationContextLoader.class)를 대체하는 새로운 @SpringBootTest(classes=MyConfig.class)

  • 기존 @ContextConfiguration(classes=MyConfig.class, loader=SpringApplicationContextLoader.class) 를 대체하는 새로운 @SpringBootTest(classes=MyConfig.class)

  • 기존 @IntegrationTest 를 대체하는 새로운 @SpringBootTest(webEnvironment=WebEnvironment.NONE)

  • 기존 @IntegrationTest와 @WebAppConfiguration 를 대체하는 새로운 @SpringBootTest(webEnvironment=WebEnvironment.DEFINED_PORT) (또는 RANDOM_PORT)

  • 기존 @WebIntegrationTest to@SpringBootTest(webEnvironment=WebEnvironment.DEFINED_PORT) (or RANDOM_PORT)

마이그레션 테스트 진행간에 당신은 또한 기존 @RunWith(SpringJUnit4ClassRunner.class)

선언문들을  스프링 4.3의 더 가독성이 좋은 @RunWith(SpringRunner.class).로 대체할 수 있다.

@SpringBootTest 어노테이션에 대한 더 자세한 정보는 다음의 링크를 참고하세요 updated documentation.

TestRestTemplate

TestRestTemplate 클래스는 더이상 직접적으로 RestTemplate 에서 extends되지 않는다. (비록 여전히 같은 메소드를 제공하긴하지만). 이로서 TestRestTemplate 는 의도치않게 주입(accidentally injected)되는 일 없이 하나의 빈 Bean으로서 설정하는게 가능해졌다.  RestTemplate 안에 실제 접근해야할 필요가 있다면 getRestTemplate() 메소드를 사용하자.


메이븐 Spring-boot.version 프로퍼티 Maven spring-boot.version property

The spring-boot.version property has been removed from the spring-boot-dependenciespom. See issue 5104 for details.

Integration Starter

spring-boot-starter-integration 은 일반적인 Spring Integration 어플리케이션에서 필요하지않은 4가지 모듈을 제거함으로서 간소화하였다.  제거된 4개의 모듈은 다음과 같다:

  • spring-integration-file

  • spring-integration-http

  • spring-integration-ip

  • spring-integration-stream

당신의 어플리케이션이 저 4개의 모듈중 하나라도 사용한다면 pom이나 build.gradle에 명시적 의존성을 추가해줘야할 것이다.

추가적으로,  spring-integration-java-dsl 과 spring-integration-jmx 은 이제 스타터에 추가되었다. DSL을 사용하는것은 당신의 어플리케이션의 Spring Intergation을 설정할때 권장되는 되는 방식이다.


Spring Batch Starter

spring-boot-starter-batch starter 는 더이상 embedded 데이터베이스에 의존성을 갖지않는다. 당신이 기존의 방식대로 사용하고 싶다면 당신이 원하는 데이터베이스 (드라이버)를 추가해줘야한다. 예를 들면:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-batch</artifactId>
</dependency>
<dependency>
    <groupId>org.hsqldb</groupId>
    <artifactId>hsqldb</artifactId>
    <scope>runtime</scope>
</dependency>

이미 다른 드라이버를 설정하여 hsqldb 를 exclusion해두었다면 이젠 exclusion을 지워버려도 된다.

Downgrading Tomcat

톰켓 8.5.4의 tomcat-juli 모듈이 이제 tomcat-embedded의 일부로 패키지 되었다.  수동으로 예전 버전의 톰켓으로 다운그레이드했었다면 이제 tomcat-juli 모듈을 추가해주어야할것이다. 자세한 방법은 다음의 문서를 참고하자 how-to documentation section.

Dispatch Options Request

spring.mvc.dispatch-options-request 의 기본 프로퍼티가  false 에서 스프링 프레임워크의 선호되는 값인 true 로 바뀌었다. 

 FrameworkServlet.doService의  OPTIONS 리퀘스트를 사용하지 않으려면 명시적으로 spring.mvc.dispatch-options-request 를 false.로 바꿔주어야한다.

Forced character encoding

캐릭터 인코딩 강제하기(forced) 이제 요청request에만 적용된다. (응답response는 아님). 요청request과 응답response 둘다 강제하려면 spring.http.encoding.force 를 true로 설정해주어야한다.

Multipart support

multipart 프로퍼티는 multipart에서 spring.http.multipart 로 바뀌었다.

Server header

 Server HTTP 응답헤더 response header 는 이제 server.server-header 프로퍼티를 설정해야지만 설정이 가능하다.

@ConfigurationProperties default bean names

When a @ConfigurationProperties bean is registered via@EnableConfigurationProperties(SomeBean.class), we used to generate a bean name of the form <prefix>.CONFIGURATION_PROPERTIES. As of Spring Boot 1.4, we have changed that pattern to avoid name clashes if two beans use the same prefix.

The new conventional name is <prefix>-<fqn>, where <prefix> is the environment key prefix specified in the @ConfigurationProperties annotation and <fqn> the fully qualified name of the bean. If the annotation does not provide any prefix, only the fully qualified name of the bean is used.

Jetty JNDI support

spring-boot-starter-jetty "스타터Starter"는 더이상 org.eclipse.jetty:jetty-jndi를 포함하지않는다. JNDI를 제티와 같이 사용중이라면 이제 스스로 이 의존성을 직접 추가해줘야만 한다.

Guava caches

구아바 캐시Guava cache 지원을 사용중인 개발자는 Caffeine으로 이주할것을 권장한다.

Remote Shell

The CRaSH properties have moved from the shell. namespace to the management.shell.namespace. Also, the authentication type should now be defined viamanagement.shell.auth.type.

Spring Session auto-configuration improvements

Spring Boot supports more backend stores for Spring Session: alongside Redis, JDBC, MongoDB, Hazelcast and in memory concurrent hash maps are also supported. A newspring.session.store-type mandatory property has been introduced to select the store Spring Session should be using.

Launch script identity

When the launch script is determining the application’s default identity, the canonical name of the directory containing the jar will now be used. Previously, if the directory containing the jar was a symlink, the name of the symlink was used. If you require more control over the application’s identity, the APP_NAME environment variable should be used.

MongoDB 3

The default version of Mongo’s Java Driver is now 3.2.2 (from 2.14.2) and spring-boot-starter-data-mongodb has been updated to use the new, preferred mongodb-driver artifact.

The auto-configuration for Embedded MongoDB has also been updated to use 3.2.2 as its default version.

Thymeleaf 3

기본값으로 스프링 부트는 타임리프 2.1을 사용하지만 이제 타임리프3와도 호환된다. 자세한 내용은 업데이트된 문서 를 찾아보자.

Executable jar layout

실행가능한 jars (executable jars)의 레이아웃이 변경되었다. 스프링부트의 메이븐, 그래들 또는 앤트지원을 통해 빌드한다면 이 변화는 영향을 미치지 않을 것이다. 당신 스스로의 실행가능한 아카이브를 통해서 빌드한다면 이제 어플리케이션이 lib이 아니라 BOOT-INF/lib 에 패키지 된다는 것을 명심하라. 어플리케이션의 클래스들은 이제 jar의 루트가 아닌  BOOT-INF/classes 에 패키지 될것이다.

Integration tests with the maven-failsafe-plugin

As of Failsafe 2.19target/classes is no longer on the classpath and the project’s built jar is used instead. The plugin won’t be able to find your classes due to the change in the executable jar layout. There are two ways to work around this issue:

  1. Downgrade to 2.18.1 so that you use target/classes instead

  2. Configure the spring-boot-maven-plugin to use a classifier for the repackage goal. That way, the original jar will be available and used by the plugin. For example

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <classifier>exec</classifier>
    </configuration>
</plugin>
Note
If you are using Spring Boot’s dependency management, there is nothing to do as you’ll use 2.18.1 by default.
Tip
Watch SUREFIRE-1198 for updates on this issue.

HornetQ

HornetQ 지원은 디프리케이트 되었다. HornetQ 사용자들은 Artemis로 이주할것을 권장한다.

New and Noteworthy

Tip
Check the configuration changelog for a complete overview of the changes in configuration.

Spring Framework 4.3

Spring Boot 1.4 builds on and requires Spring Framework 4.3. There are a number of nice refinements in Spring Framework 4.3 including new Spring MVC @RequestMappingannotations. Refer to the Spring Framework reference documentation for details.

Note that the test framework in Spring Framework 4.3 requires JUnit 4.12. See SPR-13275for further details.

Third-party library upgrades

A number of third party libraries have been upgraded to their latest version. Updates include Jetty 9.3, Tomcat 8.5, Jersey 2.23, Hibernate 5.0, Jackson 2.7, Solr 5.5, Spring Data Hopper, Spring Session 1.2, Hazelcast 3.6, Artemis 1.3, Ehcache 3.1, Elasticsearch 2.3, Spring REST Docs 1.1, Spring AMQP 1.6 & Spring Integration 4.3.

Several Maven plugins were also upgraded.

Couchbase support

Full auto-configuration support is now provided for Couchbase. You can easily access aBucket and Cluster bean by adding the spring-boot-starter-data-couchbase "Starter" and providing a little configuration:

spring.couchbase.bootstrap-hosts=my-host-1,192.168.1.123
spring.couchbase.bucket.name=my-bucket
spring.couchbase.bucket.password=secret

It’s also possible to use Couchbase as a backing store for a Spring Data Repository or as aCacheManager. Refer to the updated documentation for details.

Neo4J Support

Auto-configuration support is now provided for Neo4J. You can connect to a remote server or run an embedded Neo4J server. You can also use Neo4J to back a Spring DataRepository, for example:

public interface CityRepository extends GraphRepository<City> {

    Page<City> findAll(Pageable pageable);

    City findByNameAndCountry(String name, String country);

}

Full details are provided in the Neo4J section of the reference documentation.

Redis Spring Data repositories

Redis can now be used to back Spring Data repositories. See the Spring Data Redisdocumentation for more details.

Narayana transaction manager support

Auto-configuration support is now included for the Narayana transaction manager. You can choose between Narayana, Bitronix or Atomkos if you need JTA support. See the updated reference guide for details.

Caffeine cache support

Auto-configuration is provided for Caffeine v2.2 (a Java 8 rewrite of Guava’s caching support). Existing Guava cache users should consider migrating to Caffeine as Guava cache support will be dropped in a future release.

Elasticsearch Jest support

Spring Boot auto-configures a JestClient and a dedicated HealthIndicator if Jest is on the classpath. This allows you to use Elasticsearch even when spring-data-elasticsearch isn’t on the classpath.

Analysis of startup failures

Spring Boot will now perform analysis of common startup failures and provide useful diagnostic information rather than simply logging an exception and its stack trace. For example, a startup failure due to the embedded servlet container’s port being in use looked like this in earlier versions of Spring Boot:

2016-02-16 17:46:14.334 ERROR 24753 --- [           main] o.s.boot.SpringApplication               : Application startup failed

java.lang.RuntimeException: java.net.BindException: Address already in use
    at io.undertow.Undertow.start(Undertow.java:181) ~[undertow-core-1.3.14.Final.jar:1.3.14.Final]
    at org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainer.start(UndertowEmbeddedServletContainer.java:121) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:293) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    at sample.undertow.SampleUndertowApplication.main(SampleUndertowApplication.java:26) [classes/:na]
Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_60]
    at sun.nio.ch.Net.bind(Net.java:433) ~[na:1.8.0_60]
    at sun.nio.ch.Net.bind(Net.java:425) ~[na:1.8.0_60]
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[na:1.8.0_60]
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.8.0_60]
    at org.xnio.nio.NioXnioWorker.createTcpConnectionServer(NioXnioWorker.java:190) ~[xnio-nio-3.3.4.Final.jar:3.3.4.Final]
    at org.xnio.XnioWorker.createStreamConnectionServer(XnioWorker.java:243) ~[xnio-api-3.3.4.Final.jar:3.3.4.Final]
    at io.undertow.Undertow.start(Undertow.java:137) ~[undertow-core-1.3.14.Final.jar:1.3.14.Final]
    ... 11 common frames omitted

In 1.4, it will look like this:

2016-02-16 17:44:49.179 ERROR 24745 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Embedded servlet container failed to start. Port 8080 was already in use.

Action:

Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.

If you still want to see the stacktrace of the underlying cause, enable debug logging fororg.springframework.boot.diagnostics.LoggingFailureAnalysisReporter.

Image Banners

You can now use image files to render ASCII art banners. Drop a banner.gifbanner.jpg orbanner.png file into src/main/resources to have it automatically converted to ASCII. You can use the banner.image.width and banner.image.height properties to tweak the size, or usebanner.image.invert to invert the colors.

banner image

RestTemplate builder

A new RestTemplateBuilder can be used to easily create a RestTemplate with sensible defaults. By default, the built RestTemplate will attempt to use the most suitableClientHttpRequestFactory available on the classpath and will be aware of theMessageConverter instances to use (including Jackson). The builder includes a number of useful methods that can be used to quickly configure a RestTemplate. For example, to add BASIC auth support you can use:

@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
    return builder.basicAuthorization("user", "secret").build();
}

The auto-configured TestRestTemplate now uses the RestTemplateBuilder as well.

JSON Components

A new @JsonComponent annotation is now provided for custom Jackson JsonSerializer and/orJsonDeserializer registration. This can be a useful way to decouple JSON serialization logic:

@JsonComponent
public class Example {

    public static class Serializer extends JsonSerializer<SomeObject> {
        // ...
    }

    public static class Deserializer extends JsonDeserializer<SomeObject> {
        // ...
    }

}

Additionally, Spring Boot also now provides JsonObjectSerializer and JsonObjectDeserializerbase classes which provide useful alternatives to the standard Jackson versions when serializing objects. See the updated documentation for details.

Convention based error pages

Custom error pages for a given status code can now be created by following a convention based approach. Create a static HTML file in /public/error or add a template to/templates/error using the status code as the filename. For example, to register a custom 404 file you could add src/main/resource/public/error/404.html. See the updated reference documentation for details.

Unified @EntityScan annotation

org.springframework.boot.autoconfigure.domain.EntityScan can now be used to specify the packages to use for JPA, Neo4J, MongoDB, Cassandra and Couchbase. As a result, the JPA-specific org.springframework.boot.orm.jpa.EntityScan is now deprecated.

ErrorPageRegistry

New ErrorPageRegistry and ErrorPageRegistrar interfaces allow error pages to be registered in a consistent way regardless of the use of an embedded servlet container. TheErrorPageFilter class has been updated to that it is now a ErrorPageRegistry and not a fakeConfigurableEmbeddedServletContainer.

PrincipalExtractor

The PrincipalExtractor interface can now be used if you need to extract the OAuth2Principal using custom logic.

Test improvements

Spring Boot 1.4 includes a major overhaul of testing support. Test classes and utilities are now provided in dedicated spring-boot-test and spring-boot-test-autoconfigure jars (although most users will continue to pick them up via the spring-boot-starter-test"Starter"). We’ve added AssertJ, JSONassert and JsonPath dependencies to the test starter.

@SpringBootTest

With Spring Boot 1.3 there were multiple ways of writing a Spring Boot test. You could use@SpringApplicationConfiguration@ContextConfiguration with theSpringApplicationContextLoader@IntegrationTest or @WebIntegrationTest. With Spring Boot 1.4, a single @SpringBootTest annotation replaces all of those.

Use @SpringBootTest in combination with @RunWith(SpringRunner.class) and set thewebEnvironment attribute depending on the type of test you want to write.

A classic integration test, with a mocked servlet environment:

@RunWith(SpringRunner.class)
@SpringBootTest
public class MyTest {

    // ...

}

A web integration test, running a live server listening on a defined port:

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment=WebEnvionment.DEFINED_PORT)
public class MyTest {

    // ...

}

A web integration test, running a live server listening on a random port:

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment=WebEnvionment.RANDOM_PORT)
public class MyTest {

	@LocalServerPort
	private int actualPort;

	// ...

}

See the updated reference documentation for details.

Auto-detection of test configuration

Test configuration can now be automatically detected for most tests. If you follow the Spring Boot recommended conventions for structuring your code the @SpringBootApplication class will be loaded when no explicit configuration is defined. If you need to load a different@Configuration class you can either include it as a nested inner-class in your test, or use theclasses attribute of @SpringBootTest.

See Detecting test configuration for details.

Mocking and spying beans

It’s quite common to want to replace a single bean in your ApplicationContext with a mock for testing purposes. With Spring Boot 1.4 this now as easy as annotating a field in your test with @MockBean:

@RunWith(SpringRunner.class)
@SpringBootTest
public class MyTest {

    @MockBean
    private RemoteService remoteService;

    @Autowired
    private Reverser reverser;

    @Test
    public void exampleTest() {
        // RemoteService has been injected into the reverser bean
        given(this.remoteService.someCall()).willReturn("mock");
        String reverse = reverser.reverseSomeCall();
        assertThat(reverse).isEqualTo("kcom");
    }

}

You can also use @SpyBean if you want to spy on an existing bean rather than using a full mock.

See the mocking section of the reference documentation for more details.

Auto-configured tests

Full application auto-configuration is sometime overkill for tests, you often only want to auto-configure a specific "slice" of your application. Spring Boot 1.4 introduces a number of specialized test annotations that can be used for testing specific parts of your application:

  • @JsonTest - For testing JSON marshalling and unmarshalling.

  • @WebMvcTest - For testing Spring MVC @Controllers using MockMVC.

  • @RestClientTest - For testing RestTemplate calls.

  • @DataJpaTest - For testing Spring Data JPA elements

Many of the annotations provide additional auto-configuration that’s specific to testing. For example, if you use @WebMvcTest you can @Autowire a fully configured MockMvc instance.

See the reference documentation for details.

JSON AssertJ assertions

New JacksonTesterGsonTester and BasicJsonTester classes can be used in combination with AssertJ to test JSON marshalling and unmarshalling. Testers can be used with the@JsonTest annotation or directly on a test class:

@RunWith(SpringRunner.class)
@JsonTest
public class MyJsonTests {

    private JacksonTester<VehicleDetails> json;

    @Test
    public void testSerialize() throws Exception {
        VehicleDetails details = new VehicleDetails("Honda", "Civic");
        assertThat(this.json.write(details)).isEqualToJson("expected.json");
        assertThat(this.json.write(details)).hasJsonPathStringValue("@.make");
    }

}

See the JSON section of the reference documentation or the Javadocs for details.

@RestClientTest

The @RestClientTest annotation can be used if you want to test REST clients. By default it will auto-configure Jackson and GSON support, configure a RestTemplateBuilder and add support for MockRestServiceServer.

Auto-configuration for Spring REST Docs

Combined with the support for auto-configuring MockMvc described above, auto-configuration for Spring REST Docs has been introduced. REST Docs can be enabled using the new @AutoConfigureRestDocs annotation. This will result in the MockMvc instance being automatically configured to use REST Docs and also removes the need to use REST Docs' JUnit rule. Please see the relevant section of the reference documentation for further details.

Test utilities

spring-boot-starter-test now brings the AssertJ assertions library.

Test utilities from the org.springframework.boot.test package have been moved to a spring-boot-test dedicated artifact.

Actuator info endpoint improvements

You can now use the InfoContributor interface to register beans that expose information to the /info actuator endpoint. Out of the box support is provided for:

  • Full or partial Git information generated from the git-commit-id-plugin Maven or gradle-git-properties Gradle plugin (set management.info.git.mode=full to expose full details)

  • Build information generated from the Spring Boot Maven or Gradle plugin.

  • Custom information from the Environment (any property starting info.*)

Details are documented in the "Application information" section of the reference docs.

MetricsFilter improvements

The MetricsFilter can now submit metrics in both the classic "merged" form, or grouped per HTTP method. Use endpoints.metrics.filter properties to change the configuration:

endpoints.metrics.filter.gauge-submissions=grouped
endpoints.metrics.filter.counter-submissions=grouped,merged

Spring Session JDBC Initializer

If Spring Session is configured to use the JDBC store, the schema is now created automatically on startup.

Secured connection for Artemis/HornetQ

Spring Boot now allows to connect against a secured Artemis/HornetQ broker.

Miscellaneous

  • server.jetty.acceptors and server.jetty.selectors properties have been added to configure the number of Jetty acceptors and selectors.

  • server.max-http-header-size and server.max-http-post-size can be used to constrain maximum sizes for HTTP headers and HTTP POSTs. Settings work on Tomcat, Jetty and Undertow.

  • The minimum number of spare threads for Tomcat can now be configured usingserver.tomcat.min-spare-threads

  • Profile negation in now supported in application.yml files. Use the familiar ! prefix inspring.profiles values

  • The actuator exposes a new headdump endpoint that returns a GZip compressed hprofheap dump file

  • Spring Mobile is now auto-configured for all supported template engines

  • The Spring Boot maven plugin allows to bundle system scoped artifacts using the newincludeSystemScope attribute

  • spring.mvc.log-resolved-exception enables the automatic logging of a warning when an exception is resolved by a HandlerExceptionResolver

  • spring.data.cassandra.schema-action you be used to customize the schema action to take on startup

  • Spring Boot’s fat jar format should now consume much less memory

  • Locale to Charset mapping is now supported via the spring.http.encoding.mapping.<locale>=<charset> property

Spring Data "Ingalls" release train support

Spring Boot 1.4 GA ships with the Spring Data "Hopper" release out of the box. Users that would like to try the "Ingalls" release train (available in milestone one at the time of writing) can do so by just setting the spring-data-releasetrain.version property to Ingalls-M1 and declaring the Spring milestone repository.

Depending on what modules of Spring Data you use, you might have to upgrade a couple of transitive dependencies, too:

  • Spring Data REST users will have to upgrade to Spring HATEOAS 0.21 (set spring-hateoas.version to 0.21.0.RELEASE)

  • Spring Data Redis users using Jedis as driver will have to upgrade to 2.9 (setjedis.version to 2.9.0)

Deprecations in Spring Boot 1.4

  • Velocity support has been deprecated since support has been deprecated as of Spring Framework 4.3.

  • Some constructors in UndertowEmbeddedServletContainer have been deprecated (most uses should be unaffected).

  • The locations and merge attributes of the @ConfigurationProperties annotation have been deprecated in favor of directly configuring the Environment.

  • The protected SpringApplication.printBanner method should no longer be used to print a custom banner. Use the Banner interface instead.

  • The protected InfoEndpoint.getAdditionalInfo method has been deprecated in favor of the InfoContributor interface.

  • org.springframework.boot.autoconfigure.test.ImportAutoConfiguration has been moved toorg.springframework.boot.autoconfigure.

  • All classes in the org.springframework.boot.test package have been deprecated. See the "upgrading" notes above for details.

  • PropertiesConfigurationFactory.setProperties(Properties) is deprecated in favor of usingPropertySources.

  • Several classes in the org.springframework.boot.context.embedded package have been deprecated and relocated to org.springframework.boot.web.servlet.

  • All classes in the org.springframework.boot.context.web package have been deprecated and relocated.

  • The spring-boot-starter-ws "Starter" has been renamed to spring-boot-starter-web-services.

  • The spring-boot-starter-redis "Starter" has been renamed to spring-boot-starter-data-redis.

  • The spring-boot-starter-hornetq starter and auto-configuration has been deprecated in favour of using spring-boot-starter-artemis

  • management.security.role has been deprecated in favour of management.security.roles

  • The @org.springframework.boot.orm.jpa.EntityScan annotation has been deprecated in favor of @org.springframework.boot.autoconfigure.domain.EntityScan or explicit configuration.

  • TomcatEmbeddedServletContainerFactory.getValves() has been deprecated in favor ofgetContextValves().

  • org.springframework.boot.actuate.system.EmbeddedServerPortFileWriter has been deprecated in favor of org.springframework.boot.system.EmbeddedServerPortFileWriter

  • org.springframework.boot.actuate.system.ApplicationPidFileWriter has been deprecated in favor of org.springframework.boot.system.ApplicationPidFileWriter

Property Renames

  • spring.jackson.serialization-inclusion should be replaced with spring.jackson.default-property-inclusion.

  • spring.activemq.pooled should be replaced with spring.activemq.pool.enabled.

  • spring.jpa.hibernate.naming-strategy should be replaced withspring.jpa.hibernate.naming.strategy.

  • server.tomcat.max-http-header-size should be replaced with server.max-http-header-size.



반응형

반응형

타임리프3 5분 이주 가이즈 Thymeleaf 3 five-minute migration guide

원문: http://www.thymeleaf.org/doc/articles/thymeleaf3migration.html

당신은 Thymeleaf 2 사용자로서 새로운 Thymeleaf 3를 써보고 싶으시가요?

먼저, 좋은 소식이 있습니다. 당신이 구현해놓은 타임리프 템플릿들은 거의 100% 타임리프3와 호환될 것이므로, 당신은 단지 몇가지 설정만 바꿔주시면 됩니다.

Thymeleaf 3.0 BETA 버전은 안정적으모 2.1버전의 모든 기능을 지원합니다. 우리는 당신이 새 기능들과 성능 향상의 잇점을 취하도록 가능한한 빨리 타임리프3로 옮기기를 권장합니다.

현재 단계에서 타임리프 버전 2.1의 모든 다이얼렉트dialect들이 옮겨지진 않았다는게 약점이긴 하지만, 당신이 만약 타임리프 3에서 동작하지많은 외부 다이얼렉트를 사용중이라면, 타임리프 3와 호환되는 지 먼저 확인해보세요

템플릿 변경 Template changes

당신의 템플릿에 우리가 권장하는 유일한 변경사항은 아마도 당신이 사용하고있을 th:inline="text" 속성을 없애주는 것입니다. 왜냐하면 이들은 HTML이나 XML템플릿의 인라인 표현식을 출력하기 위해 더이상 필요하지 않기 때문입니다. 아 이건 그저 권장사항입니다 - 템플릿은 지우던 안지우던 어쨋거나 동작할 것입니다 - 하지만 당신이 이것을 지원줌으로서 성능향상이라는 혜택을 받을 수 있습니다.

더 자세한 정보는 밑의 향상된 인라인 메케니즘 섹셕을 참고사헤요

설정 변경 Configuration changes

이제 타임리프 사용자로서 가장 일반적인 선택인 thymeleaf-spring4 통합 패키지와 자바 설정을 사용한 타임리프 3의 설정의 예를 봅시다, 

먼저, 다음과 같이 타임리프3와 스프리4 통합 패키지를 얻기위한 메이븐 의존성을 업데이트합니다.

<dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf</artifactId>
    <version>3.0.0.BETA01</version>
</dependency>
<dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf-spring4</artifactId>
    <version>3.0.0.BETA01</version>
</dependency>

두번째로, 스프링 설정:

@Configuration
@EnableWebMvc
@ComponentScan("com.thymeleafexamples")
public class ThymeleafConfig extends WebMvcConfigurerAdapter implements ApplicationContextAware {
 
    private ApplicationContext applicationContext;
 
    public void setApplicationContext(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }
 
    @Bean
    public ViewResolver viewResolver() {
        ThymeleafViewResolver resolver = new ThymeleafViewResolver();
        resolver.setTemplateEngine(templateEngine());
        resolver.setCharacterEncoding("UTF-8");
        return resolver;
    }
 
    private TemplateEngine templateEngine() {
        SpringTemplateEngine engine = new SpringTemplateEngine();
        engine.setTemplateResolver(templateResolver());
        return engine;
    }
 
    private ITemplateResolver templateResolver() {
        SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver();
        resolver.setApplicationContext(applicationContext);
        resolver.setPrefix("/WEB-INF/templates/");
        resolver.setTemplateMode(TemplateMode.HTML);
        return resolver;
    }
 
}

타임리프2 설정과의 첫번째 차이점은 이제 스프링 어플리케이션을 위한 추천 템플릿이 SpringResourceTemplateResolver 라는 것입니다. 이는 설정 빈(configuration bean)이 ApplicationContextAware 인터페이스를 구현줘야만 하기 때문에 스프링 ApplicationContext에 참조(reference)가 필요합니다.

두번째 차이점은 템플릿 모드가 TemplateMode.HTMLT의 값을 가지는 것입니다. 템플릿 모드는 더이상 스트링이 아니며, 가능한 값들도 타임리프2와 약간 다릅니다. 잠시후 살펴볼 것입니다.

만일 추가적인 다이얼렉트를 추가해줘야한다면, 당신은 engine.addDialect(...) 메소드를 사용할 수 있습니다. 그러나 먼저 이것이 타임리프 3와 호환가능한 버전인지 확인해보아야 합니다.

Thymeleaf 3 + Spring 4 + Java config exampleThymeleaf 3 + Spring 4 + XML config example 그리고 Thymeleaf 3 + Servlet 3 example에서 간단한 "Hello World" 예제들의 소스코드를 찾아보거나 다운로드 할 수 있습니다.

또는 the Thymeleaf BETA 1 announcement.에서 추가적인 정보를 찾아볼 수 있습니다.

완전한 HTML5 마크업 지원 Full HTML5 markup support

타임리프 3.0은 더이상 XML 베이스가 아닙니다. 이 새 파싱 시스템에 감사하며, XML 유효한 HTML 코드를 더이상 만들 필요도 없습니다. (가독성이좋으므로 여전히 권장되기는 합니다). HTML 모드로, 타임리프는 클로징태그(closed tag), 따옴표 속성(quoted attribute)의 경우 이제 훨씬 더 관대해졌습니다.

따라서 이제 다음과 같이 더 완벽하게 처리능력이 향상된 (약간 가독성이 떨어지지만) 타임리프 템플릿이 되었습니다:

<div><p th:text=${mytext} ng-app>Whatever

새로운 파싱 시스템에 댛의 설명은 Full HTML5 support, new parsing infrastructure를 참고하세요.

템플릿 모드 Template modes

타임리프3는 이전 버전의 템플릿 모드의 묶음을 변경하였습니다. 새로운 템플릿 모드는 다음과 같습니다: 

  • HTML
  • XML
  • TEXT
  • JAVASCRIPT
  • CSS
  • RAW

2개의 마크업markup 템플릿 모드(HTML and XML), 3개의 텍스쳐textual 템플릿 모드 (TEXTJAVASCRIPT, CSS) 그리고 no-op 템플릿 모드 (RAW).

HTML 템플릿 모드는 HTML5, HTML 4 and XHTML을 포함하여 어떤 종류의 HTML 마크업 입력을 허용합니다. 제대로 구조화 했는지 확인하는 마크업 유효성검사를 수행하지않습니다. 템플릿 마크업 코드구조는 출력시 가장 큰 가능성을 가진 규모biggest possible extent를 존중할 것입니다.

다른 템플릿 모드에 대한 자세한 설명은 Thymeleaf 3.0 Template Mode set을 확인하세요.

또한 https://github.com/jmiguelsamper/thymeleaf3-template-modes-example에서 새 템플릿 모드에 대한 간단한 예제를 확인할 수 있습니다.


텍스쳐 템플릿 모드 Textual template modes

타임리프에 추가된 새로운 텍스쳐 템플릿 모드는 CSSJavascript 와 plain text를 출력할 수 있습니다. 당신의 CSS와 자바스크립트 파일들에 서버사이드 변수값을 사용하거나, 이메일 작성과 같은 plain text를 만들기 더 쉽게 되었습니다.

텍스쳐 모드에 대한 타임리프의 모든 기능을 활용하기 위해  새로운 신텍스syntax가 소개되었습니다 예를 들어, 당신은 이와 같이 iterate할 수 있습니다:

[# th:each="item : ${items}"]
    - [# th:utext="${item}" /]
[/]

이 새로운 신텍스에 대한 자세한 설명은 New syntax for textual template modes에서 확인하세요

향상된 인라인 메카니즘 Improved inlining mechanism

다음과 같이 추가적인 태그나 속성을 사용하지 않고 데이터를 손쉽게 출력할 수 있습니다:

<p>This product is called [[${product.name}]] and it's great!</p>

인라인inlining 이라 부르는 이 기능이 상당히 향상되어, 이제 타임리프3에서 훨씬 더 나은 지원이 가능하게 되었습니다. 자세한 정보는 Inlined output expressions를 확인하세요

현존의 인라인 메카니즘 또한 새로운 템플릿 보드에서 잘 작동합니다. 사실 th:inline="text" 속성은 더이상 필요하지 않습니다 왜냐하면 인라인은 이제 HTML 모드 그 자체이기 때문입니다. 자세한 정보는 Refactoring of the inlining mechanism에서 확인하세요

성능 향상 Performance improvements

타임리프 3.0의 주요한 성취는 이전 버전에서 항상 제기되었던 성능의 향상입니다.  2.1 버전까지의 XML기반의 템플릿엔진으로 수많은 훌륭한 강력한 기능들을 구현할 수 있었지만, 때때로 성능의 문제가 있었습니다. 타임리프 랜더링에 걸리는 시간이 많은 주요 프로젝트에서 무시되어 왔지만, 이 위험부담은 (수천개의 열을 가진 테이블을 다루는 고부하가 걸리는 웹사이트와 같은) 특별한 성격을 가지는 프로젝트에서 현저히 드러났습니다. 

타임리프 3 엔진은 성능에 집중하여 처음부터 다시 구현되었습니다. 타임리프3의 성능은 이전버젼보다 훨씬 더 향상되었으므로, 우리는 더욱 더 많은 프로젝트들의 다양한 요구사항을 맞출 수 있게 되었습니다. 그러나 타임리프의 성능은 단지 랜더링 시간뿐만 아니라 더 낮은 메모리 사용과 높은 병렬처리가 필요한 시나리오에 지연시간을 줄일 수 있도록 특별히 디자인되었습니다.

새로운 타임리프 3 아키텍쳐에 대한 기술적 논의는  New event-based template processing engine를 확인하세요

새로운 다이얼렉트 시스템 New Dialect system

타임리프3는 새로운 다이얼렉트 시스템을 특징지었습니다. 만일 이전 버전의 타임리프에서 이 타임리프 다이얼렉트를 개발하려면, 이것을 타임리프3 호환 가능하게 만들어줘야 할 것입니다.

새로운 다이얼렉트 인터페이스는 정말로 간단합니다...

public interface IDialect {
 
    public String getName();
 
}

…그러나 당신이 구현할 IDialecte의 구체적인 서브인터페이스에 의존하여 수많은 기능을 추가할 수 있습니다. 

새로운 다이얼렉트 시스템의 몇가지 기능을 정리해보자면:

  • 처리자processors 뿐만 아니라 선처리자pre-processors 와 후처리자post-processors가 있어 템플릿 컨텐트를 처리 전, 처리 후에 수정이 가능해졌다. 예를 들어, 캐시된 내용을 제공하기위해 선처리자를 사용하고, 출력물을 압축하고 최소화하기위해 후처리자를 사용할 수 있다.
  • 다이얼렉트 우선권Dialect precedence는 다이얼렉트를 가로지르는 프로세서들을 분류할 수 있는 새로운 개념입니다. 프로세서 Processor precedences 이제 다이얼렉트 우선권과 관련있는 걸로 간주되어 특정 다이얼렉트에 있는 모든 프로세서를 단지 다이얼렉트 우선권의 올바른 값을 설정하는 것만으로 다른 다이얼렉트로 부터의 어떤 프로세스 이전에 실행되도록 설정할 수 있습니다.
  • 객체 표현식 다이얼렉트Expression object dialects 는 새로운 객체 표현식 또는 유틸리티 객체 표현식을 제공하여 표준 다이얼렉트가 제공하는  #strings#numbers#dates와 같은 표현식을 템플릿의 어디에서나 사용할 수 있습니다. 
  • provide new expression objects or expression utility objects that can be used in expressions anywhere in templates, such as the #strings#numbers#dates, etc. provided by the Standard Dialect.

이들 기능에 대한 자세한 설명을 다음을 확인하세요:

Core API의 리펙토링 Refactoring of the core APIs

The core API는 아주 많이 리펙터되었습니다. 다음의 디테일을 확인하세요:

결 론 Final thoughts

Thymeleaf 3는 수많은 시간을 들여 공들여 작업한 지난 4년간의 타임리프 템플릿 엔진 프로젝트의 주요한 성과입니다. 훌륭한 새 기능들과 보이지 않는 곳에서의 수많은 성능 향상을 이루어냈습니다.

우리는 이 업데이트가 당신의 프로젝트에 꼭 필요한 요소들을 갖추도록 맞춰왔습니다. 그러니 이것을 시도해보는 것을 망설이지 마시고 피드백을 보내주세요!



반응형

'ReleaseNotes' 카테고리의 다른 글

스프링 부트 1.5 릴리즈 노트  (0) 2017.07.21
스프링 부트 1.4 릴리즈 노트  (0) 2016.08.06
Spring Boot 1.3.0 릴리즈 노트  (0) 2015.11.18
Spring Boot 1.2 릴리즈 노트  (0) 2015.11.18
Spring Boot 1.1 릴리즈노트  (0) 2015.11.18

반응형

스프링 부트 1.3.0 릴리즈 노트 - 2015년 11월 17일

원문: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.3-Release-Notes

스프링부트 1.2이후 업그레이드된 것

스프링 부트 1.2에서 제거된것 Deprecations from Spring Boot 1.2

스프링 부트 1.2에서 디프리케이트된 클래스, 메소드, 프로퍼티들은 이번 릴리즈에서 제거되었다.업그레이드에 앞서 디프리케이트된 메소드를 호출하는지 먼저 확인해야한다.


잭슨 Jackson

스프링 부터 1.2는 어플리케이션 컨텍스트내에 모든 ObjectMapper 를 가지는 잭슨 모듈에 등록했다. 이는 ObjectMapper bean의 모듈을 완전히 제어할수 없게 만들었기 때문에, 스프링 부트 1.3에서는 오직 자동설정된 Jackson2ObjectMapperBuilder.와 함께 설정되거나 생성된 ObjectMappers 만 잭슨 모듈 빈으로 등록된다. 이는 모듈설정의 방식을 스프링부트의 다른 잭슨설정과 똑같이 만들어줬다.


로깅 Logging

스프링 특화 설정 Spring specific configuration

스프잉 특화 로그 설정파일의 중복 초기화를 막기위해 기본 로그 설정의 이름을 -spring 접두사를 붙여쓰도록 바꿔주는것을  (필수요구사항은 아니지만) 권장한다. 예를 들면, logback.xml 파일을 logback-spring.xml로 바꾸는 것이다.


초기화 실패 Initialization failures

스프링 부트 1.2에선 logging.config 를 써서 로깅 설정파일을 커스터마이즈할 수 있었다. 파일이 존재하지않으면 기본설정을 사용해서 조용히 대비할 수 있었다. 스프링 부트 1.3는 파일이 없을경우 실패하게 된다. 유사하게, 사용자가 잘못 설정된 커스텀 로그백 설정파일을 넣어뒀다면 스프링 부트 1.2는 기본 설정으로 극복할 것이다. 스프링 부트 1.3은 시스템이 에러가 나며(falls) 설정의 문제로  System.err에 리포트된다.


스프링 HATEOAS Spring HATEOAS

스프링 HATEOAS 자동설정이 컨텍스트의 기본 ObjectMapper에 영향을 미치지 않도록 재작업되었으므로 spring.hateoas.apply-to-primary-object-mapper 프로퍼티는 삭제되었다. 이는 spring.hateoas.use-hal-as-default-json-media-type 이름의 프로퍼티로 대체되었는데 이는 스프링 HATEOAS HTTP 메세지 컨버터가  application/hal+json요청 뿐만 아니라  application/json의 요청을 처리할 지를 제어하는데 쓰인다.


/health 종단의 시큐리티 Security for the /health endpoint

actuator /health endpoint의 어떠한 정보를 보여줄지에 대한 보안 설정은 더 나은 일관성을 가지도록 약간 재조정되었다. 자세한 정보는  HTTP health endpoint access restrictions 를 참고하자.


HTTP 응답압축 HTTP response compression

스프링 부트 1.2에서 톰캣사용자를 위한 네이티브 응답 압축 또는 제티, 톰캣, Undertow 사용자를 위한 제티의 GZipFilter 를 사용하는 압축이 지원되었다. 제티팀이 gzip필터를 디프리케이트한데 영감받아 스프링부트 1.3은 이 세 내장 컨테이너에서 네이티브 응답 압축을 지원하도록 변경되었다. 그 결과 server.tomcat.compression. 그리고 spring.http.gzip. 프로퍼티는 더이상 지원하지 않는다. 새로운  server.compression.* 프로퍼티가 대신 사용된다.


톰캣 세션저장 Tomcat session storage

기본값으로 톰캣은 더이상 세션 데이터를  /tmp에 저장하지않는다. 사용자가 톰캣과 persistent 세션을 사용하려면 server.session.persistent 프로퍼티를  true로 설정하자. server.session.store-dir 는 특정위치에 파일을 저장할때 쓴다.


제티 JSP Jetty JSPs

spring-boot-starter-jetty "Starter POM" 은 더이상 org.eclipse.jetty:jetty-jsp. 을 포함하지않는다. 제티와 JSP를 함께 사용하는 사용자는 스스로 이 의존성을 직접 추가해줘야한다.


MVC Stacktrace출력 MVC Stacktrace output

Stacktrace 정보는 이제 스프링 MVC가 에러 응답을 랜더할때 포함되지않는다.스프링 부트 1.2에서 쓰던대로 유지하려면 error.include-stacktrace를 on-trace-param.로 설정하자.


타임리프의 스프링 시큐리티 통합 Thymeleaf’s Spring Security integration

스프링 시큐리티 4로의 업그레이드때문에  스프링 1.3은 타임리프의 스프링 시큐리티 지원의 자동설정과 의존성 관리 또한 업그레이드하였다. 새 artiface은 org.thymeleaf.extras:thymeleaf-extras-springsecurity4.이다 pom.xml 또는 build.gradle 를 각각 업그레이드 해줘야한다.


/template폴더가 없을때 나는 에러 Missing /templates folder errors

스프링 부트 어플리케이션은  /templates 폴더가 없다고 시작에 실패하지않는다. 스프링 부트에서 지원되는 템플릿 기술을 사용중인데 /templates 폴더를 추가하지 않았다면 이제 warning으로 로그될것이다.


그루비 템플릿 Groovy templating

GroovyTemplateProperties 는 이제 AbstractTemplateViewResolverProperties 를 확장하여 추가적인 설정옵션을 제공한다. 사용자가 현재 커스텀 리소스 위치를 정의하기위해 prefix.spring.groovy.template.prefix 프로터리를 설정해두었다면,  prefix.spring.groovy.resource-loader-location로 이름을 바꿔줘야 한다.


그래들 플러그인 Gradle plugin


bootRun 리소스 bootRun resources

스프링 부트 그래들 플러그인은 bootRun를 쓸때 클래스패스에 src/main/resources 를 직접 추가하지않는다. 만일 사용자가 실시간 즉시 편집을 원하면, Devtools 를 쓰는것을 권장한다. 스프링 부트 1.2에서 했던대로 되돌리려면 addResources 프로퍼티는 그래들 빌드에 설정할 수 있다.


의존성 관리 Dependency management

스프링의 그래들 플러그인이 이번 릴리즈에서 dependency management plugin를 사용할 수 있게 업데이트되었다. 대부분의 사용자는 이 변화에 무관하지만 자신이 설정한 버전을 적용하려는  versionManagement 설정을 사용하는 사용자들은 그들의  빌드 스크립트를 업그레이드해야한다.

버전관리를 설정하기위해 프로퍼티파일을 요구하는 대신, 새로운 플러그인이 사용자가 메이븐 bom을 쓸수있도록 해준다. 예를 들면:

dependencyManagement {
    imports {
        mavenBom 'com.example:example-bom:1.0'
    }
} 

어플리케이션 플러그인 Application plugin

스프링 부트 그래들 플러그인은 더이상 그래들의  application plugin 을 기본으로 적용하지않는다. 만일 이 어플리케이션 플러그인을 쓰려면, build.gradle.에 사용자가 적용해줘야한다.

어플리케이션 플러그인이 제공하는 기능이 필요없지만  mainClassName 나 applicationDefaultJvmArgs 프로퍼티를 쓰고싶으면 build.gradle.에 작은 업데이트만 해주면 된다.

메인클래스는 이제 springBoot extension의 mainClass 프로퍼티로 설정가능해졌다. 예를들면:

springBoot { mainClass = 'com.example.YourApplication' }

applicationDefaultJvmArgs 는 사용자 프로젝트의 ext block에서 설정할 수 있다. 예를들면:

ext {
    applicationDefaultJvmArgs = [ '-Dcom.example.property=true' ]
}

어플리케이션 플러그인의 run task에 있는 main 프로퍼티를 사용해서 사용자 프로젝트의 메인클래스를 설정하려면 다음의 설정을  bootRun task에 대신 설정해 줘야한다:

bootRun {
    main = com.example.YourApplication
}

메이븐 플러그인 Maven plugin

spring-boot:run 리소스 spring-boot:run resources

스프링 부트 메이븐 플러그인은  spring-boot:run를 쓸때 클래스패스에 src/main/resources를 직접 추가하지않는다. 만일 사용자가 실시간 즉시 편집을 원하면, Devtools 를 쓰는것을 권장한다. 스프링 부트 1.2에서 했던대로 되돌리려면 addResources 프로퍼티는 pom.xml 에 설정할 수 있다.


메이븐 리소스 필터링 Maven resources filtering

spring-boot-starter-parent를 사용한다면, 메이븐 토큰은 오직 @ 을 사용하여 필터링 한다. 이는 사용자 설정에서 빌드시 확장되는 스프링 placeholder를 막아준다.(${foo}와 같은). 

실제로 만일 사용자가  ${project.version}와 같은 표준화 포멧을 여전히 사용하고 있다면 @project.version@ 로 바꿔주거나 maven-resources-plugin 설정을 오버라이드 해야한다.


CLI의존성 관리 CLI dependency management

스프링 부트 1.3은 이제 메타데이터에 기초한 프로퍼티 파일을 대신하여 의존성관리를 설정하기 위해 메이븐 bom을 사용한다. bom의 위치를 지정하기 위한 @GrabMetadata 을 대신하여 @DependencyManagementBomsho을 사용해야한다. 예를 들면,  @DependencyManagementBom("io.spring.platform:platform-bom:1.1.2.RELEASE").


프로퍼티 이름변경 Property renames

다음의 application.properties 키들이일관성 차원에서 이름을 변경하였다:

  • spring.view.에서  spring.mvc.view.

  • spring.pidfile 에서 spring.pid.file

  • error.path 에서 server.error.path

  • server.session-timeout 에서 server.session.timeout

  • servet.tomcat.accessLogEnabled 에서 server.tomcat.accesslog.enabled

  • servet.tomcat.accessLogPattern 에서 server.tomcat.accesslog.pattern

  • servet.undertow.accessLogDir 에서 server.undertow.accesslog.dir

  • servet.undertow.accessLogEnabled 에서 server.undertow.accesslog.enabled

  • servet.undertow.accessLogPattern에서 server.undertow.accesslog.pattern

  • spring.oauth2. 에서 security.oauth2.

  • server.tomcat.compression 와 spring.http.gzip 에서server.compression.*

  • prefix.spring.groovy.template.prefix 에서prefix.spring.groovy.resource-loader-location


의존성 Dependencies


스프링 4.2 Spring 4.2

스프링 부트 1.3은 스프링 프레임워크 4.2 또 그 이후 버전이 필요하다. 그 이전버전과는 호환되지않는다.


스프링 시큐리티 4.0 Spring Security 4.0

스프링 부트 1.3은 스프링 시큐리티 4.0을 사용한다. 시큐리티 3.2에서 마이그레이션에 대한 정보는 스프링 시큐리티 문서를 확인하자.


주목할만한 새 기능

변경된 설정를 둘러보려면 설정 변경기록 을 확인하자.


버전 업데이트 Version Updates

스프링 부트 1.3빌드는 스프링 프레임워크 4.2를 필요로 한다. 몇몇 서드파티 의존성이 이 릴리즈에 맞춰 업그레이드 되었다. 이번 릴리즈에는 톰캣과 제티 버전에 주요한 업데이트는 없다.


개발자 툴 Developer Tools

스프링부트 1.3 은 개발시간을 향상을 목적으로 하는 새로운 spring-boot-devtools 메소드를 지원한다.이 모듈이 제공하는 것들은:

  • 민감한 프로퍼티의 기본값들 (예를 들면 템플릿 캐시를 disable하는)

  • 어플리케이션 자동 재시작

  • LiveReload 지원

  • 원격 개발 지원 (HTTL터널을 통한 원격 업데이트와 원격 디비깅을 포함).

  • 재시작해도 이어지는 Persistent HTTP 세션

자세한 정보는 업데이트된 문서를 보자.


캐싱 자동설정 Caching Auto-configuration

다음과 같은 캐시 기술에 대한 자동설정이 지원된다:

  • EhCache

  • Hazelcast

  • Infinispan

  • JCache (JSR 107)를 호환하는 구현체들

  • Redis

  • Guava

더우기, 간단한 Map 기반 메모리 상주 캐싱 또한 지원된다. 캐싱은 사용자의 어플리케이션의  @Configuration이 @EnableCaching와 같이 어노테이션되어있으며 자동적으로 등록된다. 캐시 통계 또한 이제 actuator endpoint로서 노출된다 ( 관련된 근원기술을 허용할때만)

자세한 정보는 업데이트된 문서를 보자.


온전히 실행가능한 JAR와 서비스 지원 Fully executable JARs and service support

스프링 부트 메이븐과 그레들 플러그인은 이제 리눅스/유닉스 시스템을 위한 full executable archives를 만들수 있다. 더우기, 사용자는 이들 JAR들은 다음과 같이 타입함으로서 init.d 또는 systemd 서비스로서 쉽게 인스톨할 수 있다:

$ ./myapp.jar

그리고 이렇게 init.d 서비스로 인스톨한다:

$ sudo link -s /var/myapp/myapp.jar /etc/init.d/myapp

추가적인 정보는 레퍼런스 문서를 참고하자


카산드라 지원 Cassandra Support

카산드라의 자동 설정이 지원된다. 자세한 정보는 레퍼런스 문서를 참고하자.


OAuth2 지원 OAuth2 Support

이제 @EnableAuthorizationServer 와 @EnableResourceServer를 사용하여 OAuth2 인증 및 리소스 서버를 재빠르게 만들 수 있다. 뿐만 아니라  @EnableOAuth2Client는 사용자 어플리케이션에  OAuth2 클라이언트로 동작할 수 있게 해준다. 자세한 정보는 재정비된 레퍼런스 문서의 보안섹션을 참고하자.


스프링 세션 Spring Session

클래스패스에 스프링 세션과 스프링 데이터 레디스를 넣으면 웹어플리케이션은 이제 레이스에서 사용자 세션을 저장하도록 자동설정될 것이다.  accompanying sample 에서 자세한 정보를 확인하자.


jOOQ 지원 jOOQ Support

jOOQ의 자동등록을 지원한다. 형변환에 안전한(type safe) 데이터베이스 쿼리를 만드려면 사용자의 bean에 jOOQ의 DSLContext를 직접  @Autowire 하면된다. 추가적인 커스터마이즈가 spring.jooq.* 어플리케이션 프로퍼티를 통해 지원된다. 

자세한 정보는 레퍼런스 문서의 "jOOQ 사용하기" 섹션을 참고하자.


센드그리드 SendGrid

SendGrid 이메일 배송서비스의 자동등록을 지원한다.


Artemis 자동설정 Artemis auto-configuration

2015년 HornetQ가 아파치 재단에 기부하여 아파치 Artemis가 만들어졌다. 스프링 부트 1.3부터 아파치 Artemis를 완벽하게 지원하며 HornetQ와 거의 같은 방식을 사용한다. 사용자가 Artemis 를 사용하려면, spring.hornetq. 프로퍼티를  spring.artemis.로 이름 변경하면 된다.


"Starter POM" 검증 Validation "Starter POM"

새로운 spring-boot-starter-validation starter POM 이 추가되어 bean validation (JSR 303) support할 수 있다.


@WebServlet, @WebFilter와 @WebListener 지원 Support for @WebServlet, @WebFilter and @WebListener

내장 서블릿 컨테이너를 사용할때 @WebServlet,@WebFilter 그리고 @WebListener 어노테이션된 클래스를 자동등록이 @ServletComponentScan을 사용함으로서 가능해졌다.


스프링 리소스체인 Spring resource chains

사용자는 이제 스프링의 application properties를 통해  ResourceChainRegistration 의 기본 aspect을 설정할 수 있다. 이는 사용자가 캐시파열cache busting을 구현하기 위한 고유한 리소스 이름을 만들수 있게 해준다.  spring.resources.chain.strategy.content. 프로퍼티는 만약 사용자가 사용자의 fingerprint에 "고정된 버전"fixed version을 쓰길 원하면 리소스의 내용에 기초해  fingerprinting을 설정하는데 쓰인다. 


JDBC

스프링 부트는 다음과 같은 데이터베이스의 JDBC URL로 부터 드라이버 클래스 이름을 자동으로 가져온다:

  • DB2

  • Firebird

  • Teradata


데이터소스 타입 DataSource type

자동설정이 사용하는 커넥션 풀connection pool은 spring.datasource.type 설정키를 통해  명시할 수 있다.


H2 웹콘솔 H2 Web Console

H2의 web console 의 자동설정이 추가되었다. 스프링부트의 개발자 툴을 쓸때 사용자의 웹 어플리케이션에  com.h2database:h2 의존성만 추가하면 바로 사용할 수 있다. 자세한 정보는 문서를 참고하자.


내장 몽고DB Embedded MongoDB

내장 MongoDB 가 자동설정에 추가되었다. de.flapdoodle.embed:de.flapdoodle.embed.mongo 의존성이 시작시 필요하며, 버전과 같은 설정을 사용하려면 application.properties를 통해 설정할 수 있다. 자세한 정보는 문서를 참고하자.


ANSI 컬러 banner.txt 파일 ANSI color banner.txt files

이제 사용자의 banner.txt 파일에 출력물에 색깔을 입힐 수 있는 ANSI placeholders를 사용할 수 있다. 예를 들면:

${AnsiColor.BRIGHT_GREEN}My Application
${AnsiColor.BRIGHT_YELLOW}${application.formatted-version}${AnsiColor.DEFAULT}

 

기본 프로파일 application.properties Default profile application.properties

-default 접미사는 이제 특정 프로파일이 활성화되지않았을때 application.properties (또는 application.yml) 파일을 읽는다. 이 것은 사용자가 배포환경을 명시하는 프로파일을 사용할때 유용할 것이다.

FileDescription

application.properties

항상 불러오는 공유 프로퍼티

application-prod.properties

prod 프로파일이 활성활됬을때 불러오는 프로퍼티

application-staging.properties

staging 프로파일이 활성활됬을때 불러오는 프로퍼티

application-default.properties

활성화된 프로파일이 없을때 불러오는 프로퍼티


어플리케이션 인자들 Application arguments

사용자는 이제 CommandLineRunner를 대신하는 ApplicationRunner 인터페이스를 구현할 수 있다. 같은 방식으로 동작하지만  String[]이 아닌ApplicationArguments 인터페이스로서 인자를 제공할 수 있다. 만일 사용자가 어플리케이션 인자들에 접근해야한다면, 이미 있는 아무 bean에 직접 ApplicationArguments를 주입할 수 있다.

 ApplicationArguments 인터페이스는  "option" 과 "non-option" 인자들을 위한 편리한 메소드를 제공한다. 예를 들면:

@Autowired
public MyBean(ApplicationArguments args) {
    boolean debug = args.containsOption("debug");
    List<String> files = args.getNonOptionArgs();
    // if run with "--debug logfile.txt" debug=true, files=["logfile.txt"]
}

어플리케이션 인자 접근하기 에서 자세한 정보를 확인하자.


로깅 Logging

로깅 패턴 Log Patterns

logging.pattern.console 과 logging.pattern.file 프로퍼티는 이제 사용자의 application.properties파일을 통해 직접 로깅패턴을 지정할 수 있다. 사용자의  log*.xml파일을 정의할 필요없이 패턴을 커스터마이즈하길 원하는 경우 손쉽게 이용할 수 있다.


stacktrace에서 Jar 디테일 Jar details in stacktraces

사용자가 logback or log4j2를 사용중이라면, stack trace안의 각 클래스의 위치에 대한 정보가 로드될것이다. (이것은 logging.exception-conversion-word를 통해 바꿀 수 있다.) 

If you are using logback or log4j2, we now include information about the location from which each class in a stack trace was loaded (this can be customized vialogging.exception-conversion-word).


Log4J 2 출력 Log4J 2 Output

Log4J 2’의 기본 출력이 향상되어 Logback의 출력물과 비슷해졌다.


톰캣 접근 로그 Tomcat access logs

톰캣 접근로그(access logs)는 더 커스커마이징할 수 있게 되었다: 디렉토리, 파일의 접두사/접미사를 이제 설정을 통해 커스터마이즈 할 수 있다.


로그백 확장 Logback extensions

스프링 부트 1.3은 사용자가 logback 설정파일안에서 사용할 수 있는 몇 개의 새로은 태그를 지원한다. 태그를 쓰려면 사용자는 먼저 logback.xml 설정파일을 logback-spring.xml로 이름을 바꿔줘야 한다. 일단 이름을 바꿨다면 다음의 태그를 사용할 수 있다:

태 그

설 명

<springProfile>

사용자 마음대로 활성화된 스프링 프로퍼티에 기초한 설정을 포함하던지 배제할지 허용한다.

<springProperty>

Logback에서 사용하는 스프링 환경변수(Spring Environment)의 프로퍼티를 불러오는 것을 허용한다.

레퍼런스 문서의 Logback extensions 섹션에서 자세한 정보를 확인하자.


HTTP 세션 HTTP Sessions


Persistent 세션 Persistent sessions

톰캣, 제티, Undertow는 어플리케이션이 멈췃을때와 재시작되어 다시 로드될때 세션데이터를 serialize하도록 업데이트되었다. Persistent  세션은 opt-in이라  ConfigurableEmbeddedServletContainer의 persistentSession 이나  server.session.persistent=true 프로퍼티를 사용하여 설정할 수 있다. (Persistent 세션은 Devtools에서 기본적으로 enabled 되어있다)

persistent 세션 데이터를 저장하는 위치는 server.session.store-dir 프로퍼티를 사용하여 지정할 수 있다.


향상된 HTTP 세션 설정 Advanced HTTP Session configuration

부가적인 프로퍼티들이 세션 설정을 위해 제공되어 이제 server.session.* 프로터리를 사용하여 "tracking modes" 와 "cookie" details을 설정할 수 있다.


X-Forwarded-For 헤더지원 X-Forwarded-For header support

X-Forwarded-For header 지원이 제티와 Undertow에 추가되었다. 톰캣 또한 X-Forwarded-For headers를 반영되어야 한다면 단일 server.use-forward-headers 프로퍼티를 true로 설정 할 수 있도록 새로 고쳐졌다. 스프링부트는 Cloud Foundry 나 Heroku의 배포를 감지하여 자동으로 enable되도록 지원한다.


설정 프로퍼티 Configuration properties

Bean에서 @ConfigurationProperties 를 사용하고 있다면, 사용자는 더이상 스프링 부트의 자동설정으로의 당신의 설정파일에 @EnableConfigurationProperties 를 추가해주지 않아도 된다. 기존엔 @EnableConfigurationProperties 의 값속성을 사용하거나 정식으로 하는 @Bean 정의를 함으로서 사용자의  @ConfigurationProperties클래스를 위해 스프링에 bean을 만들라고 했었다.

 

메세징 Messaging

JMS와 Rabbit endpoints 둘다 이제 설정을 통해 쉽게 disabled할 수 있게 되었다. 아무 설정없이 생성된 기본 컨테이너 팩토리가 있다면 또한 설정을 통해 커스터마이즈 할 수 있다.


국제화 Internationalization

자동설정된 MessageSource 인스턴스의 fallbackToSystemLocale 플래그를 spring.messages.fallback-to-system-locale 설정키를 통해 제어할 수 있다.


자동설정 Auto-configuration

자동설정 리포트는 "Unconditional classes"라 불리는 추가적인 섹션을 가진다. 이것은 어떤 클래스레벨 조건을 가지지 않은 자동설정 클래스를 리스트해준다. 예를 들면 언제나 어플리케이션 설정의 한 부분인 클래스 @SpringBootApplication(exclude=…​)또는 @EnableAutoConfiguration(exclude=…​)를 통해 수동으로 배재excluded된 설정에 리스트되어질 것이다.

spring.autoconfigure.excludes 프로퍼티를 통해 자동설정 클래스에서 제외하는것 또한 가능해졌다. 유사하게 새 @ImportAutoConfiguration 어노테이션을 써서 특정 자동설정 클래스를 선별적으로 import해야하는 테스트를 할 수 있다.


MVC 에러 핸들링 MVC Error handling

error.include-stacktrace 프로퍼티는 스택 트레이스 속성을 MVC 에러 응답에 넣을지 결정하는데 사용한다. 옵션은 neveralways 또는 on-trace-param 이 있다. (기본값은 never).


엑츄에이터 메트릭스 Actuator Metrics

spring-boot-actuator 메트릭스가 export 와 aggregation을 지원하도록 확장되었다. 또한 자바8 특화 GaugeService 와 CounterService 구현이 제공되어 개선된 성능을 제공해준다.

자세한 정보는 확장된 metrics documentation for details.


부가적인 Health Indicators

다음의 부가적인  HealthIndicators  제공되어 자동설정된다.:

  • Elasticsearch

  • Email

  • JMS


새로운 actuator endpoints

다음의 부가적인 actuator endpoints 가 스프링부트 1.3에 추가되었다:

이름설 명

/logfile

로그파일로 접근할 수 있다.(설정해두었을경우).

/flyway

적용해둔 Flyway 데이터베이스 마이그레이션의 자세한 정보를 제공한다.

/liquibase

적용해둔 Liquibase 데이터베이스 마이그레이션의 자세한 정보를 제공한다.


액츄에이터 종단을 위한 CORS지원 CORS support for actuator endpoints

Actuator’s endpoint는 이제 CORS를 지원한다. 기본값은 disabled되어 있지만 endpoints.cors.allowed-origins.설정을 enabled함으로서 사용할 수 있다.


/env와 /metrics를 위한 정규식 지원 Regex support for /env and /metrics

사용자는 정규식을 사용하여 /env and /metrics actuator endpoints를 필터할 수 있다. 예를들면,  http://localhost:8080/metrics/.root..


MVC 액츄에이터 종단을 위한 하이퍼미디어 Hypermedia for MVC actuator endpoints

Actuator HTTP endpoints는 이제 사용자가 클래스패스에 Spring HATEOAS가 있으면 (예를 들면,  spring-boot-starter-hateoas를 통해), 하이퍼링크를 보여줄 수 있게 개선되었다. 새로운 "discovery page" 또한 모든 actuator endpoints의 링크들을 제공해준다. 클래스패스에 HAL browser의 webjar가 있으면 HAL browser를 위한 지원 또한 제공된다. 자세한 정보는 "Hypermedia for MVC Endpoints"  레퍼런스 섹션을 보자.


Actuator docs endpoint

새로운 spring-boot-actuator-docs 모듈이 스프링 부트 1.3에 추가되어 actuator 문서를 사용자 어플리케이션에 내장하는것이 가능해졌다. 일단 해당 모듈이 클래스패스에 있다면, 사용자는 /docs를 타입하여 각각 endpoint에서 리턴받은 데이터의 샘플을 포함하는 actuator endpoints의 정보를 얻을 수 있다.


Disabling health indicators

management.health.defaults.enabled 프로퍼티를 통해 기본 health indicators를 전부 손쉽게 disable시킬수 있다.


TraceWebFilter options

(HTTP 요청/응답의 디테일을 추적하는데 쓰이는Actuator TraceWebFilter 가 이제 더 많은 정보를 로그한다.이것을 사용하려면  management.trace.include 프로퍼티를 쓰면된다. (TraceProperties.Include enum을 참고하자)


메이븐 지원 Maven Support


Maven start/stop support and admin features

메이븐 플러그인에  start 과 stop goals이 추가되었다. 이들은 메이븐의 방해없이 어플리케이션을 시작할 수 있게 해준다.( 다른 goals이 어플리케이션을 가동할수 있게 해줌으로서). 이 기술은 메이븐으로부터 통합테스트를 실행할때 자주 쓰인다.

이 작업의 부산물로서 새로운 SpringApplicationAdminMXBean 인터페이스가 추가되어 스프링 부트 어플리케이션이 JMX를 통해 제어될수있게 허용되었다 (enabled 설정했을경우)


Profile activation

spring-boot-maven-plugin은 spring-boot:run.과 함께 사용할 수 있는 profiles 프로퍼티를 제공한다. 사용자의 pom.xml 에서 또는 커맨드라인에서 -Drun.profiles 을 사용함으로서 프로파일을 설정할 수 있다. 자세한 정보는 updated plugin documentation 를 참고하자.


Ant Support

스프링 부트는 이제 Ant를 통해 실행가능한 jars를 만들 수 있는 AntLib 모듈을 제공한다. 레퍼런스 문서의 "Spring Boot AntLib module" 섹션을 보라.


Configuration property meta-data updates

META-INF/spring-configuration-metadata.json 파일포멧이 업데이트되어 새로운 deprecation 과 hints 속성을 지원한다. Hints는 IDE개발자가 사용하여 더 나은 컨텐트 도움말을 보여줄 수 있으며, Deprecation은 deprecation과 replacement key를 설정할 수 있다. 만일 필요하다면 그러한 정보들은 프로퍼티의 getter에 @DeprecatedConfigurationProperty 를 추가함으로서 제공할 수 있다. updated appendix 에서 자세한 정보를 확인하자.

기본값의 인식 또한 향상되었다: 만일 프로퍼티가 단일 인자를 가지는 하나의 메소드호출을 통해 초기화되면, 해당 인자가 초기값으로 간주될 것이다. (예를들면, Charset.forName("UTF-8") 은 기본값으로 UTF-8 으로 인식된다)

자신의 툴과 앱에서 configuration meta-data을 사용하고 싶어하는 툴개발자를 위해 새로운 spring-boot-configuration-metadata 모듈이 추가되었다. 이것은 메타데이터를 읽고 그것을 리파지토리에서 빌드할 수 있는 API가 제공된다.


Spring Boot CLI

CLI 는 이제 의존성 해결dependency resolution동안 메이븐 settings.xml 의 리파지토리 설정을 사용할 수 있다. 리파지토리를 쓰려면 프로파일에 활성화해줘야 한다.

CLI 는 또한 이제 실행가능한 WAR파일을 만들수 있다. $ spring war <filename.war> <script.groovy>를 사용하자.


Miscellaneous

다음과 같은 잡다한 업데이트 또한 스프링 1.3에 포함되었다:

  • 자바8을 쓰면 잭슨의 자바8 모듈이 자동적으로 등록된다.

  • TransactionTemplate bean 은 이제 TransactionAutoConfiguration의 일부로 포함되었다.

  •  MailServer bean 은 이제 spring.mail.jndi-name 프로퍼티를 사용하는 JNDI를 통해 얻어진다.JNDI 

  • 사용자는 이제  server.display-name 프로퍼티를 통해 서블릿 이름을 등록할 수 있다. (내장 서블릿 컨테이너를 쓸때) 

  • Flyway migration strategies 은 이제 FlywayMigrationStrategy bean를 통해 설정할 수 있다.

  • 새로운 SpringBootVersion  클래스가 추가되었다. (코어프레임워크의 SpringVersion 과 유사하다).

  • 사용자는 이제 amcrest matchers를 OutputCapturet과 같이 사용하여 특정한 결과의 테스트 산출물을 검증할 수 있다.

  •  사용자는 이제 Elasticsearch non local nodes를 사용해서 스프링 부트를 설정할 수 있다.

  • ApplicationPidFileWriter는 이제 fail-on-write-error프로퍼티를 통해 exception 설정을 할 수 있다. (업데이트된 javadoc를 참조하자)

  • 메이븐 플러그인은  spring-boot:run과 함께 사용할 수 있는 useTestClasspath 옵션이 추가되었다.

  • DB2와 Informix를 위한 추가적인 데이터베이스 heath 쿼리가 추가되었다.

  • 프로퍼티 바인딩 실패는 이제 더 나은 Exception 메시지를 보여준다.

  • @SpringBootApplication 어노테이션에  scanBasePackages 와 scanBasePackageClasses 속성이 추가되었다.

  • 새로운 AllNestedConditions 과 NoneNestedConditions 가 추가되었다. (현존하는 AnyNestedCondition과 비슷)

  • 활성화된 프로퍼티Active profiles는 이제 어플리케이션이 시작할때 출력로그output log를 프린트한다.

  • spring.main.banner-mode 프로퍼티는 CONSOLELOG 또는 OFF output 간에 스위치하는데 사용할 수 있다.

  • 원격 DevTools 은 이제 프록시 서버뒤에서 작동한다. (spring.devtools.remote.proxy.* 프로퍼티를 보자)

  • (Java 8 에서 지원하는) 잭슨의 parameter names module가 이제 사용자의클래스패스에 있으면 자동설정된다.

  • 스프링의 웹소켓 메세지 변환기message converters는 이제 자동설정된다.

  • 새로운 DelegatingFilterProxyRegistrationBean 클래스가 추가되어 DelegatingFilterProxy.를 거친 내장 서블릿 컨테이너와 함께 등록할 수 있게 되었다.


Deprecations in Spring Boot 1.3.0

  •  setBannerMode사용을 유도하기 위해 Application.showBanner와 ApplicationBuilder.showBanner메소드는 디프리케이트되었다.

  • @ConditionalOnMissingClass는 이제  name.보다 value 속성을 사용하여 제공되기때문에 클래스 이름이 필요하다.

  • 아파치의 log4j 1.x의 서비스 종료(EOL)선언에 따라 Log4JLoggingSystem 는 디프리케이스되었다.

  • ConfigurableEmbeddedServletContainer setJspServletClassName 과 setRegisterJspServlet 메소드는 setJspServlet로 대체되었다.

  • EndpointMBean 클래스(와 서브클래스들)은 이제 생성자에 제공되려면 ObjectMapper 이 필요하다.

  • DropwizardMetricWriter 는 DropwizardMetricService로 대체되었다.

  • String[] 을 가지는 protected SpringApplication.afterRefresh 메소드는 ApplicationArguments.을 가지는 버젼에 의해 디프리케이트되었다.

  • CloudFoundryVcapEnvironmentPostProcessor에 의해 VcapEnvironmentPostProcessor 는 디프리케이트되었다.

  • LoggingSystem initialize 메소드는 LoggingInitializationContext받는 버젼에 의해 디프리케이트 되었다.

  • org.springframework.boot.autoconfigure.orm.jpa.EntityManagerFactoryBuilder 는 디프리케이트되어 새 패키지  org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder를 사용해야한다.


반응형

반응형

스프링 부트 1.2 릴리즈 노트 - 2015년 5월 16일


원문: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.2-Release-Notes

스프링 부트 1.1이후 업그레이드 된 것

서블릿 3.1, 톰캣8 그리고 제티9 Servlet 3.1, Tomcat 8 and Jetty 9

스프링부트는 이제 내장 서블릿 컨테이너로 톰캣8과 제티9를 사용한다. 이들은 서블릿 3.1과 바로 사용가능한 향상된 웹소킷을 제공해준다. 예전 버전을 선호한다면 여전히 톰캣7과 제티8을 쓸수있다 다운그레이드의 예제로 spring-boot-sample-tomcat7-jsp 와 spring-boot-sample-jetty8 을 참고하자.


로깅 출력 Logging output

기본 로깅설정이 업데이트되 서 더이상 로그파일을 쓰지않는다. 만약 파일출력을 원하면  logging.path 나 logging.file 프로퍼티를 사용할 수 있다. 또한 사용자는 여전히 logback.xml 파일을 추가함으로서 로깅을 완전하게 커스터마이즈할 수 있다.


지속적 HTTP URI/body 디코딩 Consistent HTTP URI/body decoding

consistent URI/body decoding을 위해 CharacterEncodingFilter 는 이제 자동으로 등록된다. 만약 UTF-8 이외의 것이 필요하면 spring.http.encoding.charset 프로퍼티를 쓰면된다 또는 CharacterEncodingFilter  가 모두 등록하는게 싫으면 spring.http.encoding.enabled 을 false로 설정하자.


IgnoreDefaultModelOnRedirect with Spring MVC

스프링 MVC 자동설정은 이제 RequestMappingHandlerAdapter의 ignoreDefaultModelOnRedirect 프로퍼티가 기본적으로 true 설정된다. 사용자가 모델속성값 model attributes을 리다이렉션 URL의 일부로 필요로 한다면, application.properties에 다음과 같이 추가하면 된다:

spring.mvc.ignore-default-model-on-redirect=false

잭슨 기본설정값 Jackson defaults

잭슨 자동설정은 이제 MapperFeature.DEFAULT_VIEW_INCLUSION 과 DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES의 기본값이 disabled로 설정된다. 이전의 설정을 사용하려면  application.properties에 다음과 같이 추가하면된다:

spring.jackson.mapper.default-view-inclusion=true
spring.jackson.deserialization.fail-on-unknown-properties=true

몽고와 몽고DbFactory Bean Mongo and MongoDbFactory Beans

MongoAutoConfiguration 클래스는 사용자가 자신의 MongoDbFactory bean을 정의해두면 더이상 Mongo bean을 등록하지않을것이다. 따라서 Mongo 데이터베이스에 접근하려면 자신의 MongoDbFactory bean을 선언할때 사용자가 Mongo bean을 등록하던가 또는  MongoDbFactory interface만을 쓰던가 결정해야한다.


health.* 프로퍼티는 management.heath.*로 이동 Moved health.* properties to management.health.*

헬스 관련 설정키들은 다른 management관련 프로퍼티와의 형평성에 맞춰 health 에서 management.health로 옮겨졌다. 


VanillaHealthIndicator 클래스의 이름변경 Renamed VanillaHealthIndicator class

VanillaHealthIndicator 클래스는 ApplicationHealthIndicator로 이름이 바뀌었다. 대부분의 사용자는 이 클래스를 직접적으로 연동하지않을테지만 이미 코드에 org.springframework.boot.actuate.health.VanillaHealthIndicator 를 import해서 쓰고 있다면, org.springframework.boot.actuate.health.ApplicationHealthIndicator로 바꿔줘야할것이다.


하이버네이트 Hibernate

SpringNamingStrategy 클래스가 org.springframework.boot.orm.jpa.hibernate 패키지로 이동되었다. 기존의 org.springframework.boot.orm.jpa.SpringNamingStrategy는 그대로 남아있지만 deprecated되었고 차후 릴리즈에서 삭제될 것이다.  hibernate-envershibernate-jpamodelgen그리고  hibernate-ehcache를 위한 Managed 의존성이 추가되었다.


PersistenceExceptionTranslationPostprocessor

PersistenceExceptionTranslationPostProcessor 이제 기본적으로 등록된다. exception translation set이 필요없으면 spring.dao.exceptiontranslation.enabled 프로퍼티를 false설정하자.


헬스 JSON Health JSON

The /health actuator endpoint JSON에 단일 HealthIndicator 와 연관되어 약간의 변화가 있었다. 이미 특정 JSON경로로 쿼리했었다면 아마 모니터링 툴을 업데이트해야할 수도 있다.


익명의 health 접근 제한 Anonymous health access restrictions

/health actuator endpoint 는 이제 익명의 접근이 제한된다. 익명으로 접근하면 endpoint는 health의 자세한 정보를 보여주지않으며 간단히 서버가 UP인지 DOWN만을 알려준다. 또한 endpoints.health.time-to-live에의해 명시된 시간만큼 응답이 캐시된다. 이러한 제약은 disalbed 할 수 있기때문에 1.1.x 버전대로 되돌리려면 endpoints.health.sensitive false.로 설정하자.


스프링 4.1 Spring 4.1

스프링 부트 1.2는 이제 Spring Framework 4.1.5 버전이 필수이며 더이상 Spring Framework 4.0 버전과 호환되지않는다.


히카리 CP Hikari CP

스프링 부트의 의존성관리에 의해 제공되는 com.zaxxer:HikariCP 의 버전은 이제 자바 8을 써야만한다. 자바6나 자바7을 쓴다면, com.zaxxer:HikariCP-java6 로 사용자의 의존성을 업데이트 해줘야한다.


설정 프로퍼티 Configuration Properties

spring.data.mongo.repositories.enabled 프로퍼티는 spring.data.mongodb.repositories.enabled로 이름이 바뀌었다.


디프리케이션 Deprecations

  • org.springframework.boot.actuate.system.ApplicationPidListener 클래스는  ApplicationPidFileWriter로 대체되었다.

  • CLI @EnableRabbitMessaging 애노테이션은 spring-rabbit 프로젝트의  @EnableRabbit로 대체되었다..

  • http.mappers. 프로퍼티는 spring.jackson.serialization과 동일하므로 디프리케이트 되었다.

  • properties are deprecated in favor of theirspring.jackson.serialization. equivalents.

  • org.springframework.boot.json.SimpleJsonParser 는 "JSON Simple"라이브러리와의 혼동을 피하기 위해 BasicJsonParser 를 권장하기 위해 디프리케이트 되었다.


주목할만한 새 기능 New and Noteworthy

버전 업데이트 Version Updates

스프링 부트 1.2를 빌드하려면 스프링 프레임워크 4.1이 필요한다. Jackson, Joda Time and Hibernate Validator 등등의 몇몇 서드파티 의존성이 이 릴리즈에 맞춰 업그레이드되었다. 기본 내장 서블릿 컨테이너가 이제 톰캣8과 제티9를 사용한다.(서블릿 3.1지원에 의해)


@SpringBootApplication annotation

사용자가 빈번하게 사용하는 3개의 애노테이션 @Configuration + @EnableAutoConfiguration + @ComponentScan과 동일하게 작동하는 새로운 @SpringBootApplication 애노테이션이 추가되었다.


JTA Support

스프링 부트 1.2는 이제 Atomkos또는 Bitronix 내장 트랜잭션 매니저를 사용하는 다수의 XA리소스를 위한 분산 JTA 트랜잭션을 지원한다. JTA transactions are also supported when deploying to a suitable Java EE Application Server.

JTA 환경이 감지되면, 스프링의 JtaTransactionManager 가 트랜잰션을 관리하는데 사용된다.JMS, DataSource와 JPA 자동설정 빈들이 XA 트랜잭션을 지원하도록 업그레이드된다. 사용자는 @Transactional같은 표준 Spring 용어로 이 분산 트랜잭션을 사용할 수 있다.

추가적으로, @EnableAutoConfiguration를 쓰지않아도 Atomkos 와 Bitronix을 더 쉽게 설정할 수 있는 지원 클래스들이 제공된다. 자세한 정보는 레퍼런스 문서의 JTA 섹션을 참고하자.


JNDI Lookups

완전한 Java EE 어플리케이션을 사용중이라면 JNDI로부터 DataSource와 JMS ConnectionFactory beans 둘다 검색lookup 할 수 있다. application.properties 또는 application.yml 파일의 spring.datasource.jndi-name 와 spring.jms.jndi-name 프로퍼티를 사용하자.


Jackson customization

이제  spring.jackson 프로퍼티를 사용하여 Jackson ObjectMapper를 커스터마이즈 할 수 있다. Jackson의 SerializationFeatureDeserializationFeatureMapperFeature,JsonParser.Feature 그리고 JsonGenerator.Feature 객체들을 serializationdeserializationmapperparser and generator 프로퍼티를 사용하여 커스터마이즈 할 수 있다. 예를 들면, DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES 를 enable하려면  application.properties에 다음과 같이 추가하면된다. 

spring.jackson.deserialization.fail-on-unknown-properties=true

추가적으로 spring.jackson.date-format 그리고 spring.jackson.property-naming-strategy프로퍼티가 스프링 1.2에 추가되었다.


Banner Interface

SpringApplication.setBanner(…​) 의 조합으로 사용할 수 있는 새로운 Banner 인터페이스가 추가되여 커스터마이즈된 배너 출력을 제공한다. 간단한 배너를 위해 src/main/resources/banner.txt 를 쓰는것을 여전히 권장하지만. 더 멋있게 보이려면 새 인터페이스가 유용할 것이다.


Banner Properties

src/main/resources/banner.txt 파일에  ${application.version}${spring-boot.version},${application.formatted-version} 그리고  ${spring-boot.formatted-version} 변수들을 사용할 수 있어 스프링부트나 어플리케이션의 버전을 출력할 수 있다.   (v1.2.0.RELEASE) 와 같이  formatted-version 을 괄호안에서 v접두어를 포함하여 쓸 수 있다.


JMS Support

자동설정이 이제 스프링 프레임워크 4.1의  @JmsListener 어노테이션을 지원한다. 사용자 클래스패스에 spring-jms.jaro이 있으면 @EnableJms 어노테이션 또한 자동설정된다.


AMQP Support

유사하게, 자동설정이 스프링 AMQP1.4의 @RabbitListener어노테이션을 지원한다. 사용자의 클래스패스에 spring-rabbit.jar 이 있다면  @EnableRabbit 어노테이션 또한 자동설정된다. 기존의 Rabbit 자동설정도 자동적으로 RabbitMessagingTemplate을 생성하도록 확장되었다.


Spring Cloud Connectors

자동설정은 spring-cloud-connectors 를 추가하였다. 새로운 spring-boot-starter-cloud-connectors POM 또한 릴리즈에 포함되었다. 자동설정은 @CloudScan 어노테이션과 기능적으로 동일하게 제공될것이다.


Email Support

새로운 spring-boot-starter-mail-starter POM이 자동설정 지원에 맞춰 추가되었다. 이메일을 보내기위해 사용자의 서비스에  JavaMailSender bean 을 주입할 수 있다. spring.mail.* 프로퍼티는 SMTP host 같은 아이템들을 커스터마이즈하는데 쓰인다.


Undertow Embedded Servlet Container

톰캣과 제티뿐만 아니라 스프링부트는 이제 내장 서블릿 컨테이너로서 Undertow 도 지원한다. 자세한 정보는 레퍼런스 문서를 보자.


CLI Updates

Creating a new project

spring CLI 커맨드라인 툴은 새 init 옵션을 추가하여 start.spring.io를 통해 새로운 프로젝트를 만들 수 있다. 예를 들면 새 웹 어플리케이션을 만드려면 다음과 같이 타입하자:

$ spring init -d=web myapp.zip


CLI extensions

CLI extension은 이제 CLI 자체로 인스톨/ 언인스톨이 가능하다. spring install <maven coordinates> 은 원격 jar를 찾아 CLI에 인스톨할 것이다. spring uninstall 은 이전에 설치된 extension을 삭제하는데 쓰인다.


CLI changes

CLI 는 이제 스프링의 @Cacheable 어노테이션을 감지하고 지원한다


제티와 톰캣의 선언적 SSL Declarative SSL with Jetty and Tomcat

SSL은 이제 다양한 server.ssl.* 프로퍼티를 확용하여 선언적으로 설정할 수 있다. 톰캣과 제티 둘다 지원한다. 자세한정보는 레퍼런스 문서를 보자


Actuator Endpoints

글로벌 endpoints.enabled 프로퍼티가 추가되어 만일 endpoint의 기본값이 enabled인지 disabled인지 설정이 할 수 있다. 이것은 사용자가 현재 opt-out 모델에서 opt-in 모델로 전환할 수 있게 해준다. 예를 들면, 사용자가 application.properties에 다음과같이 추가 함으로서 health 를 제외한 모든 endpoints를 disabled 시킬 수 있다.

endpoints.enabled=false
endpoints.health.enabled=true

Metrics

System metrics

시스템 매트릭스는 이제 힙, 쓰레드, 클래스, 가비지 콜랙션의 정보를 제공한다.


DataSource metrics

DataSource pool metrics 는 이제 /metrics actuator endpoint를 통해 노출된다. 동작중인 연결갯수, Tomcat, Hikari and Commons DBCP connection pools의  자세한 풀 사용현황 등이 보여진다.


Tomcat session metrics

내장 서블릿 컨테이너로 톰캣을 사용중이라면, 매트릭스는 작동중인 세션수, 최대 세션수를 보여줄것이다.


Dropwizard metrics

Dropwizard’s MetricRegistry 로 온 아이템들은 이제 자동으로 /metrics endpoint에 보여질 것이다. 게이지와 카운터들은 단일 값으로 반영된다. 타이머, 미터, 히스토그램도 숫자 타입의 프로퍼티로 메트릭스에 설정되도록 확장될것이다.


Health indicators

JSON format

/health actuator endpoint 는 이제 실제로 포함된 HealthIndicators와 무관하게 일관된 JSON을 돌려준다. 이 변화는 특정아이템을 위한 JSON 쿼리를 더 쉽게 만들어준다.


DataSourceHealthIndicator

DataSourceHealthIndicator는 이제 spring.datasource.validation-query 프로퍼티를 사용하여 (설정했을 경우) 데이터베이스의 건강상태를 체크할 것이다.


DiskSpaceHealthIndicator

이제 남은 디스크용량이  /health indicator 의 일부분으로 보고되어 특정 한계치 ( 기본값은 10M) 밑으로 떨어지면 DOWN 상태로 바뀌는데 사용된다. health.diskspace.path 와 health.diskspace.threshold 프로퍼티는 indicator를 커스터마이즈하는데 사용된다.


Conditions

@ConditionalOnProperty 어노테이션에 새로운 havingValue 와 matchIfMissing 속성값이 추가되어 이제 훨씬 더 복잡한 프로퍼티 매칭 컨디션property matching conditions을 만드는데 사용할 수 있다. 새 AnyNestedCondition 클래스 또한 추가되어 다른 @Conditions을 작성하는데 쓸 수 있다. 마지막으로  @ConditionalOnBean 어노테이션은 이제  클래스뿐만 아니라 String 속성으로도 선언할 수 있다.


GSON Support

이제 Jackson 출력물을 만드려면 Jackson을 대신해 GSON을 쓸 수 있게 되었다. Jackson은 여전히 권장되는 방식이고 기본설정값이지만 사용자가 Jackson을 필요로하는 Spring Boot’s Actuator를 쓰지않는다면, 메이븐/그레들 빌드로부터 Jackson라이브러리를 제외시킴으로서 GSON을 사용할 수 있다. 스프링 부트 1.2.2버전부터 Gson과 Jackson이 동시에 클래스패스에 있을 경우,  GSON을 사용하려면 spring.http.converters.preferred-json-mapper 를 gson으로 설정해주면 된다.


EmbeddedServerPortWriter

spring-actuator 프로젝트에 새로운 org.springframework.boot.actuate.system.EmbeddedServerPortFileWriter클래스가 추가되었는데 어플리케이션이 시작할때 파일에 내장 서버의 포트넘버를 적어서 사용할 수 있다.


Log4j2

Log4J 는 이제 추가된 spring-boot-starter-log4j2 start POM 로 대체할 수 있다. Logback은 여전히 기본설정으로 남아 권장하는 로깅시스템이다.


Jersey auto-configuration

Jersey의 자동설정이 지원된다. 자세한 정보는 레퍼런스를 참조하자.


Apache-Commons DBCP2 Support

아파치 commons-dbcp2 데이터베이스 커넥션 풀 라이브러리가 Tomcat, Hikari 그리고 DBCP (v1).에 이어 지원된다.


Maven Plugin

spring-boot-maven-plugin 의 repackage 작업을 disabled 시킬 수 있다. 이는 FatJars 가 필요없는 사용자가 spring-boot:run 을 쓰려고 할때 유용하다.


Configuration meta-data

이제 spring-bootspring-boot-autoconfigure 와 spring-boot-actuator jars에 추가적인 메타데이터 파일을 넣을수 있어 툴 개발자가 `application.properties 파일에 `code completion'을 제공하는데 사용할 수 있다. 어노테이션 프로세서 또한 @ConfigurationProperties 클래스로부터 자동적으로 사용자 자신의의 파일을 만들수 있게 


Miscellaneous

다음의 잡다한 업데이트들 또한 스프링 부트 1.2에 포함되었다.

  • RedisProperties클래스는 이제 database 필드를 포함한다. 

  • RelaxedDataBinder클래스는 alais 프로퍼티를 지원한다. 

  • 정규식은 이제 모든 keystosanitize 프로퍼티들과 함께 사용할 수 있다. 

  • Ansi출력은 이제 spring.output.ansi.enabled 프로퍼티로 설정가능하다. 

  •  /public/static/resources폴더에 favicon.ico 파일을 넣을 수 있다. (다른 정적 웹에셋과 같이) 

  •  ApplicationPidFileWriter (이전엔 ApplicationPidListener) 에 의해 쓰여진 파일의 위치는 spring.pidfile 프로퍼티를 사용하거나 PIDFILE 환경변수를 이용하여 특정할 수 있다.

  • 톰캣 DataSource 정보는 이제 JMX를 통해 자동으로 노출된다

  •  @Configuration 와 함께 어노테이트된 SpringBootServletInitializer 서브클래스들은 더이상 자신을 소스로 등록하기 위해 .configure 메소드를 오버라이드 할 필요 없다.

  • 사용자가 선호한다면 이제 application 프로퍼티의 포멧으로 XML을 쓸 수 있다


반응형

반응형

스프링 부트 1.1 릴리즈 노트 - 2014년 6월 13일

스프링 부트 1.0이후 업그레이드된 것

테스트 의존성 Test dependences

spring-boot-starter-test POM 은 더이상 spring-boot-starter-parent에 자동으로 포함되어지지 않는다. 부모POM에 테스트 의존성을 기본으로 추가한것은 좋은 아이디어 같았지만, 불행하게도 이들은 쉽게 수정하거나 제거되지않았다.

1.0에서 1.1로 업그레이드되면서 이젠  spring-boot-starter-test 의존성을 직접 추가해줘야한다.


레디스 드라이버 Redis Driver

스프링 부트 1.0은  Lettuce Redis 드라이버를 사용했왔으나 1.1부턴 Jedis 드라이버로 교체되었다. 대부분의 사용자는 쉽게 알아차릴수 있을것이다.


건강지표들 HealthIndicators

HealthIndicator 인터페이스는 더 명시적 API로 바뀌었다. 이젠 언제나 부가적인 맥락정보(contextual information.)와 커스터마이징할 수 있는  Status 정보를 가지는 Health 인스턴스를 리턴한다. ApplicationContext에 등록된 모든 HealthIndicators를 리턴받은 Health 인스턴스는 새로 소개된  HealthAggregator.인터페이스의 구현체에 의해 합쳐졌다. 디폴트 HealthAggregator 구현체는 Status.UPStatus.DOWN orStatus.OUT_OF_SERVICE 와 같은 모든 내장된 Status 타입에의 최우선 순위를 가진다. 이 순위는 새로 소개된 custom Status 코드를 지원하려고 설정하거나 확장할수 있다.

 /health MVC endpoint 은 이제 다른 Status 코드의 다른 HTTP상태코드를 리턴하도록 설정할 수 있다.  이를테면, 기본값으로 Status.DOWN은 503을 Status.UP는 200을 리턴한다. Status 와 HttpStatus 의 매핑 역시 사용자의 필요에 따라 설정을 바꾸거나 확장할 수 있다.

 SimpleHealthIndicator클래스는 DataSourceHealthIndicator로 이름이 변경되었다. 추가적으로 Mongo, Redis, Rabbit 와 Apache Solr를 지원하는 basic health check 역시 추가되었다. Spring Boot Actuator를 쓸때 이러한 health checks 들은 자동적으로 추가된다. 데이터저장장치 나 메시징시스템 역시 자동으로 찾아준다. (auto-detected). 필요시 특정 health checks의 생성을 막을수도 있다.


JMS 업데이트 JMS Changes

JmsTemplate 클래스는 pubSubDomain 의 기본값이 이제 기존의 true에서  false 로 바뀌었다. TheJmsTemplateAutoConfiguration 클래스는 JmsAutoConfiguration로 이름이 바뀌었다. ActiveMQAutoConfiguration 클래스는 이제 activemq 서브패키지에 포함되었다.


에러컨트롤러 ErrorController

ErrorController 인터페이스와 연관된 클래스는 spring-boot-actuator 에서 spring-boot-autoconfigure로 옮겨졌다.  대부분의 사용자는 쉽게 알아차릴수 있을것이다. 하지만 몇몇의 패기지이름변경이 또한 바뀌었다.


멀티파트 설정 Multipart Config

MultiPartConfigFactory 는 MultipartConfigFactory 로 이름이 변경되었다. (note the different case).


스프링 데이터 자동설정 패키지 Spring Data auto-configuration packages

스프링 데이터 자동설정 클래스는 서브패키지로 옮겨졌다. 대부분의 사용자는 이것들을 직접적으로 사용하지는 않을테니잠 만일 @EnableAutoConfigurationexclude 속성을 통해 참조한다면 아마 import를 바꾸어야 할것이다.


리엑터 Reactor

스프링 부트 이제 Reactor 1.1.2 를 기본으로 제공한다. (스프링부트 1.0.x에서는 Reactor 1.0.1 제공해왔다). Reactor 1.1 에서는 reactor-tcp 모듈이 reactor-net로 이름이 변경되었으므로 사용자가 reactor-tcp 를 써왔다면 reactor-net 로 의존성을 바꿔야할것이다.


메이븐에서 앱실행하기 Running your app using Maven

스프링 부트는 이제 앱을 실행하기위한 프로세스를 fork할수 있다. (예를 들면 mvn spring-boot:run를 사용). 이것의 명확한 의미는 커맨드라인의 인수들 arguments 은 더이상 어플리케이션에 사용할 수 없다. 자세한 정보는 예제 를 참조하자.



주목할만한 새 기능

버젼 업데이트 Version Updates

몇몇의 서드파티 의존성이 곧 등장할  Spring IO Platform 릴리즈에 정의된 버젼에 맞게 업그레이드 되었다. 스프링 부트 그래들 플러그인을 통해  custom version meta-data file 또한 사용할 수 있게 되었다.


템플릿 추가 지원 Additional Templating Support

 현재 지원하는 Thymeleaf and JSP 에 추가하여 Freemarker, Groovy 와 Velocity 템플릿을 지원한다.

 

메트릭스와 헬스 종단 Metrics and Health Endpoints

/metrics actuator endpoint는 이제 힙 디테일, 클래스 로딩수, 쓰레드 정보, 가비지 컬랙션 통계와 같은 더 많은 정보를 포함한다. HealthIndicator는 다수의 bean을 등록할 수 있게 향상되었으며 이미 지원하는 JDBC indicator와 함께 Redis, Mongo and RabbitMQ indicators 또한 out of the box로 지원할 수 있게 추가되었다 


메이븐 플러그인 Maven Plugin

스프링 부트 메이븐 플러그인은 이제 excludes 를 지원하여 사용자의 "fat" jar의 일부분으로 번들되는 라이브러리들을 필터링 할 수 있게 되었다.  플러그인 문서 또한 이제 하나의 maven site서 발행할 수 있게 되었다.


그래들 플러그인 Gradle Plugin

스프링 부트 그래들 플러그인은 spring-boot-dependencies POM에 기반하여 이제 자동으로 exclusion 룰을 적용한다. 자세한 정보는 레퍼런스 문서 를 참고하자.


커스텀 배너 Custom Banner

사용자의 클래스패스에 이제 banner.txt 파일을 추가하거나  banner.location 프로퍼티를 설정함으로서 커스텀 배터를 추가할 수 있다. 


Flyway 데이터베이스 마이그레이션 Flyway database migrations

Flyway 데이터베이스 마이그레이션을 위한 자동설정auto-configuration을 제공한다.


리퀴베이스 데이터베이스 마이그레이션 Liquibase database migrations

Liquibase 데이터베이스 마이그레이션을 위한 자동설정auto-configuration을 제공한다.


몽고 Mongo

몽고 자동설정이 향상되어  Mongo,MongoDbFactory 나 MongoTemplate beans을 인젝션할 수 있다. GridFS 지원또한 자동설정된  GridFsTemplate bean을 통해 추가할 수 있다.


젬파이어 GemFire

Spring Data GemFire를 지원하는 새로운 spring-boot-starter-data-gemfire 모듈을 추가되었다.


호넷Q HornetQ

 새로운 spring-boot-starter-hornetq starter POM과 함께 HornetQ JMS broker를 위한 자동설정이 추가되어 클래스패스에  org.hornetq:hornetq-jms-server 를 쓰면 내장 HornetQ broker가 기본으로 자동설정된다. 자세한 정보는 문서를 참고하자.


일레스틱 서치 Elasticsearch

 새로운 spring-boot-starter-data-elasticsearch starter POM과 함께 Elasticseach를 위한 자동설정이 추가되었다.


아파치 Solr Apache Solr

새로운  spring-boot-starter-data-solr starter POM과 함께 아파치 Solr를 위한 자동설정이 추가되었다.


웹지원 향상 Web Improvements

Spring HATEOAS와 Spring Data Rest MVC를 위한 자동설정이 추가되었다. 멀티파트 파일 업로드 지원도 기본으로 enabled되게 설정이 바뀌었다.


스프링 소셜 Spring Social

페이스북, 트위터, 링크드인 커넥터를 쓸수있는 스프링 소셜의 자동설정이 추가되었다.


스프링 모바일 Spring Mobile

SitePreferenceHandler이 스프링 모바일 자동설정에 업데이트되었다.


스프링 인티그레이션  Spring Integration

Spring Integration의 자동설정이 추가되었다. 사용자의 클래스패스에 Spring Integration이 있으면 Spring Integration JMX beans뿐만 아니라  @EnableIntegration 이 자동으로 설정된다.


스프링 WS Spring-WS

새로운 spring-boot-starter-ws이 스프링 웹서비스 지원을 통해 쓸 수 있게 되었다.


잭슨 Jackson

Jackson JSON marshaling 라이브러리 지원이 향상되었다. 사용자는 이제 JodaModule andJSR310Module 뿐만 아니라 Jackson의 ObjectMapper 를 위한 자동설정빈을 쓸 수 있으며 이들이 자동으로 적용된 자신만의 Module bean 또한 추가할 수 있다.


히카리 데이터소스 HikariDataSource

Hikari Connection Pool 라이브러리가 추가되었다. Tomcat DBCP를 쓰면 하지 못하는 사용자의 클래스패스에 위치한 HikariCP 라이브러리를 간단히 보장해준다.


새 조건부 어노테이션 New Conditional Annotations

두개의 새로운  @Conditional 어노테이션이 추가 되었다. @ConditionalOnProperty 는 Environment 프로퍼티의 설정을 기반으로 bean을 조건부로 enabling해주는 기능이고  @ConditionalOnJava 는  JVM 버젼을 기반으로 bean을 enable 해주는 것이다.



반응형

+ Recent posts