1️⃣ 프로젝트 가져오기
⏺️New Project 클릭
⏺️Gradle클릭
⏺️자바 버전 21 클릭 후
create아래가 설치가 안끝나고 변경이 되면 버그가 일어날 수 있으니, 기다려주세요
프로젝트를 클릭해서 Get from Version Control클릭
⏺️Repository URL 클릭
⏺️복사한 주소를 URL칸에 넣는다.
👇복사 주소
https://github.com/codingspecialist/springboot-blog-v4/
2️⃣ git 커밋 헤더옮기기
a. git log 조회
해당 프로젝트는 완성본이기 때문에, 커밋 헤더를 옮겨줘야된다.
GIT LOG로 조회
Bash
git log커서를 아래로 계속 내려서 ‘화면 구현 완료’ 커밋로그를 찾는다.
우린 백엔드를 해볼것이기 때문에, 화면 구현 완료부터 시작해보자.
’q’를 누르면 커맨드 라인으로 빠진다.
b. 커밋 헤더 옮기기
⏺️commit 헤더를 옮긴다. 위 커밋 번호 기억하고 아래 명령어 넣기
⏺️그리고 완료 메시지와 다사라진 클래스들
Bash
git reset --hard 5424c. 오늘 날짜 최신버전 업데이트 (24.02.03 기준)
버전 업데이트 하기
⏺️자바 → 21
⏺️스프링 부트 → 3.2.2
⏺️코끼리 클릭
3️⃣ yml설정하기
application.yml 설정을 dev로 바꾼다.
Java
spring:
profiles:
active:
- devapplication-dev.yml 클릭하여 아래와 같이 세팅한다.
Java
server:
servlet:
encoding:
charset: utf-8
force: true
session:
timeout: 30m
port: 8080
spring:
mustache:
servlet:
expose-session-attributes: true
expose-request-attributes: true
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:test;MODE=MySQL
username: sa
password:
h2:
console:
enabled: true
jpa:
hibernate:
ddl-auto: create
show-sql: true
properties:
hibernate:
format_sql: true4️⃣ 디렉토리 구조 세팅
⏺️
board, user패키지를 shop.mtcoding.blog 내부에 만든다.
⏺️ UserController 클래스는 user 패키지에
⏺️ BoardController클래스는 board패키지에 넣고 controller 패키지 삭제a. 잘 작동 되는지 확인
아래 주소를 넣어서 서버가 잘 돌아가는지 확인한다.
메뉴도 다 눌러서 각페이지 요청이 잘 되는지 확인
Java
// 주소창에 복사해서 엔터
http://localhost:8080/loginForm세팅 완료
