SpringBoot

스프링부트 3백앤드 개발자 되기 : 자바 편 1장 정리 (스프링부트 환경 세팅)

나는주민 2025. 2. 14. 12:27

참고 자료 : https://github.com/shinsunyoung/springboot-developer

 

GitHub - shinsunyoung/springboot-developer: 📚 <스프링부트 3 백엔드 개발자 되기> 예제코드

📚 <스프링부트 3 백엔드 개발자 되기> 예제코드. Contribute to shinsunyoung/springboot-developer development by creating an account on GitHub.

github.com

 

참고해놓으면 유용할 것 같은 단축키들

 

new project에서 java 선택 후 build.System을 Gradle / JAVA 버전 17로 선택 후 프로젝트 생성


1 ) build.gradle 에서 의존성 주입을 한다. (기존 Gradle 프로젝트 -> 스프링 부트 3 프로젝트 로 변경하는 과정) 

plugins {
    // Java 프로젝트를 위한 Gradle 플러그인
    id 'java'
    
    // Spring Boot 플러그인 (버전 3.0.2 사용)
    id 'org.springframework.boot' version '3.0.2'
    
    // Spring의 의존성 관리를 위한 플러그인 (버전 1.1.0 사용)
    id 'io.spring.dependency-management' version '1.1.0'
}

group 'me.shinsunyoung' // 프로젝트의 그룹 ID
version '1.0'           // 프로젝트 버전
sourceCompatibility = '17' // Java 17 버전 사용

repositories {
    // 필요한 라이브러리를 가져올 저장소 (Maven Central)
    mavenCentral()
}

dependencies {
    // Spring Boot 웹 애플리케이션을 위한 필수 라이브러리
    implementation 'org.springframework.boot:spring-boot-starter-web'
    
    // JUnit 기반의 테스트 기능을 위한 라이브러리
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
    // JUnit5 (JUnit Platform) 테스트 엔진 사용
    useJUnitPlatform()
}

 

오른쪽 위 코끼리 버튼 ( 새로고침 ) 을 눌러서 build.gradle 파일을 갱신해준다 .

 


2) src/main/java/me.shinsunyoung 경로에서  springbootdeveloper 패키지 생성 후 SpringBootDeveloperApplication.java 

어노테이션과 외부 라이브러리를 import 해준다 . (해당 빨간줄 alt + enter )
7행에 있는 '재생'버튼이나 오른쪽 위 서버 RUN 아이콘을 눌러서 스프링부트를 실행


3) 포스트맨 설치하기  https://www.postman.com/downloads 

 

Download Postman | Get Started for Free

Try Postman for free! Join 35 million developers who rely on Postman, the collaboration platform for API development. Create better APIs—faster.

www.postman.com

Create a request 누르고 나오는 창이다 여기서 localhost의 URL을 메소드에 따라 입력해 사용하면 된다