programing

Springboot 1.X와 Springboot 2.0의 차이점

linuxpc 2023. 7. 15. 09:46
반응형

Springboot 1.X와 Springboot 2.0의 차이점

응용 프로그램에 Springboot 1.X를 사용하고 있습니다.이제 몇 가지 새로운 애플리케이션을 시작할 준비가 되었습니다. SpringBoot 2.0으로 할지, 아니면 SpringBoot 1.X로 할지 고민하고 있었습니다.

어떤 버전에 대한 의견이 있습니까?

또한 Spring Boot 1.X와 Spring Boot 2.0의 차이점은 무엇입니까?

감사해요.

차이점 및 마이그레이션 가이드는 https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide 에서 확인할 수 있습니다.

  • Java 8은 기본 버전입니다.
  • 속성 변경됨
  • 봄 날씨연작write-properties-as-properties=true는 기본값입니다.
  • Spring Security 구성이 쉬워짐
  • Spring Security Oauth2가 Spring Security에 통합됩니다.
  • 향상된 종속성 관리

SpringBoot 2.* 변경 사항:

1. Java 8은 최소 버전입니다.

2. Tomcat 버전 8.5는 최소입니다.

3.Hibernate 버전 5.2는 최소입니다.

4.Gradle 버전 3.4는 최소입니다.

5. WebFlux용 스프링 부트 스타터 및 Cassandra, MongoDBRedis대한 사후 대응 지원 추가.

6.자동 구성

a. 보안(상태 등과 같은 액추에이터 끝점을 노출하려면 빈을 추가해야 함)

샘플 코드: (필요에 따라 아래 코드 수정)

@Configuration
public class ApplicationSecurity extends WebSecurityConfigurerAdapter {

  @Override
  public void configure(WebSecurity web) throws Exception {
     web
        .ignoring()
            .antMatchers("/**");
     }
  }

b.spring-boot-starter-보안 종속성을 추가해야 합니다.

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
  1. 액추에이터 끝점 변경:

    2시 전에.http://localhost:8080/business-customer/profile/env에서 세부 정보를 제공합니다.

    2.*: http://localhost:8080/business-customer/profile/actuator/env에서 세부 정보를 제공합니다.

  2. application.properties엔드포인트 속성(모든 엔드포인트 사용 가능)

    경영진, 경영진web.vmdk.vmdk=* management.vmdk입니다.web.dll.dll=로거

  3. 기본적으로 연결 풀:

    2시 전에.tomcat

    2. 이후: 히카리 CP(SpringBoot 2부터).HikariCP 종속성과 구성빈 생성 및 속성 변경을 추가할 필요가 없습니다.)

  4. 마이그레이션: https://spring.io/blog/2018/03/12/upgrading-start-spring-io-to-spring-boot-2

구성 요소 스캔에서 자동 테이블 만들기, DB 연결에 이르기까지 대부분의 항목이 2배로 자동 구성됩니다.

다음을 수행할 수 있습니다. https://www.baeldung.com/new-spring-boot-2

  1. Spring Boot 2.x는 Java 9를 지원하는 첫 번째 버전입니다.

  2. 2.x에서는 기본적으로 정적 리소스 및 Actuator 끝점을 포함한 모든 항목이 보안됩니다.

  3. Spring Boot 1.x에서는 액추에이터 끝점에 대해서만 Spring-MVC가 지원되었습니다.그러나 2.x에서는 독립적이고 플러그인이 가능해졌습니다.

  4. 2.x에서는 devtools에 의해 애플리케이션이 재시작되면 'delta' 보고서가 출력됩니다.

  5. Tomcat 최소 지원 버전은 8.5입니다.

  6. 최대 절전 모드 최소 지원 버전은 5.2입니다.

  7. Gradle 최소 지원 버전은 3.4입니다.

언급URL : https://stackoverflow.com/questions/49204882/difference-between-springboot-1-x-and-springboot-2-0

반응형