본문 바로가기
Dev/Spring Boot

[스프링 부트 개념과 활용] 스프링 부트 소개

by dev_jsk 2020. 8. 18.
728x90
반응형

주요 목표

- 모든 스프링 개발을 할 떄 획기적으로 빠르고 광범위하게 액세스할 수 있는 시작 환경을 제공

- 요구사항이 Spring의 범위에서 벗어나면 유연하게 외부에서 대처가 가능

- 대규모 프로젝트의 운영에 적합한 Features를 제공

  (e.g embedded servers, security, metrics, health checks, externalized configuration)

- XML 설정을 더 이상 사용하지 않고 코드 Generation도 사용하지 않음

 

참고

https://docs.spring.io/spring-boot/docs/2.0.3.RELEASE/reference/htmlsingle/#getting-started-introducing-spring-boot

 

Spring Boot Reference Guide

This section dives into the details of Spring Boot. Here you can learn about the key features that you may want to use and customize. If you have not already done so, you might want to read the "Part II, “Getting Started”" and "Part III, “Using Spr

docs.spring.io

 

스프링 부트 시작하기

 

프로젝트 생성

1. Ctrl + Shift + p Command Palette Open 후 Create Maven Project 선택

 

2. Project Language, Group Id, Artifact Id선택

 

3. Spring Version, Dependency 선택

 

4.  Project Location

경로 지정

 

5. Dependency

// pom.xml

<!-- Inherit defaults from Spring Boot -->
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.3.RELEASE</version>
</parent>

<!-- Add typical dependencies for a web application -->
<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    
    <!-- Spring Boot Test Annotaion -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</test>
    </dependency>
    
    <!-- JUnit -->
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>5.4.2</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>5.4.2</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<!-- Package as an executable jar -->
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

 

6. Application Run

요청을 처리하는 핸들러를 아직 만들지 않았기 때문에 Whitelabel Error Page 표시
Tomcat Port 정보 로그 및 동작 완료 로그

 

참고

https://docs.spring.io/spring-boot/docs/2.0.3.RELEASE/reference/htmlsingle/#getting-started-maven-installation

 

Spring Boot Reference Guide

This section dives into the details of Spring Boot. Here you can learn about the key features that you may want to use and customize. If you have not already done so, you might want to read the "Part II, “Getting Started”" and "Part III, “Using Spr

docs.spring.io

 

728x90
반응형

댓글