1. Spring Boot 만들기

서주홍's avatar
Aug 14, 2024
1. Spring Boot 만들기

■ 무작정 Spring Boot 만들기

 
notion image
  • Spring Boot
    • Name ⇒ Project 이름
    • Location ⇒ 경로
    • Language ⇒ 사용 언어
    • Type ⇒ 라이브러리 사용 타입?
    •  
       
      notion image
  • File → Settings
 
notion image
  • Plugins 선택 → Marketplace 선택
  • Install 되어 있으면 체크 박스 표시가 된다.
 
notion image
  • 검색하기
    • Lombok
    • Spring Boot DevTools
    • Spring Web
    • Mustache
    • Spring Data JAP
    • H2 Database
      • 해당 6개 Install 눌러주기.(체크 표시 있으면 OK)
      • 완료 후 Create 클릭
 
notion image
 
// 라이브러리 dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-mustache' implementation 'org.springframework.boot:spring-boot-starter-web' compileOnly 'org.projectlombok:lombok' developmentOnly 'org.springframework.boot:spring-boot-devtools' runtimeOnly 'com.h2database:h2' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' }
  • dependencies ⇒ 클라우드에 저장해놓고 ‘ ’ 에 문자를 적어주면 자동으로 다운로드 시켜준다.
 
notion image
  • templates 폴더에 .keep 파일을 만들어주고 board 폴더를 만들어서 mustache파일을 옮겨주자
    • 이유는 저렇게 안하면 폴더 트리가 깨져서 나중에 templates 폴더를 사용 못하게된다.
      • shift + f6 으로 이름 변경 가능
      • mustache로 확장자를 바꿔준다.
      • static 폴더는 정적
      • templates 폴더는 동적
 
notion image
  • Handlebars/Mustache 도 Install 해주자.
 
notion image
  • 저장할때 자동정렬 시켜준다.
    • Actions on Save 검색
      • Reformat code 체크
      • Optimize imports 체크
        • 완료 후 OK 버튼 클릭
 
Share article

maestrojava