inblog logo
|
eunmouse
    springboot

    [블로그 만들기] 1. 프로젝트 세팅

    순수 HTML 과 자바로만 블로그를 만들어보자. (자바스크립트/CSS 없이)
    Aug 20, 2024
    [블로그 만들기] 1. 프로젝트 세팅
    Contents
    1. 프로젝트 세팅
     
    스프링으로 결과물인 블로그를 만드는 게 1차 목표이다.
    코드에 익숙해져야 한다. 이해가 안되면 외우면 된다.

    1. 프로젝트 세팅

     
    New Project 에서 Spring Boot 를 선택하고, 아래와 동일하게 세팅한다.
    파일 저장 위치도 구분해야 하니, springwork 로 설정해준다.
    shop.mtcoding 은 도메인 주소(mtcoding.shop)인데 거꾸로 적는 것.
     
    notion image
     
    Next 눌러서 나오는 화면에서 빨간 박스와 동일한 dependencies 를 검색하여,
    체크 표시 해주고 Create 한다.
     
    notion image
     
    로딩 될 때까지 잠시 기다렸다가
    File 에서 Settings 에 들어가,
     
    notion image
     
    Plugins 에서 Lombok 이 체크 되어 있는지 확인, 아니면 체크해서 OK 누르면 된다.
     
    notion image
     
    그리고 build.gradle 에 가보면 dependencies 에 선택한 라이브러리들이 들어와 있다.
     
    notion image
     

    라이브러리

    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'
     
    글자를 토대로 자동으로 gradle 이 해준다.
    라이브러리는 라이브러리들끼리 의존을 한다.
    라이브러리 A 가 B 에 의존하는 경우, 내 입장에서는 A, B 같이 들고 와야 한다.
    빌드 시스템(그래들)을 사용하면, 내가 A 들고 오면 필요한 B 까지 자동으로 다운 받아 준다.
     
    💡
    빌드 시스템의 대표적 도구 : Maven (메이븐), Gradle (그래들)
     
    라이브러리에 변동이 생기면, 오른쪽 상단에 reload 를 위한 코끼리가 생긴다. 고것을 눌러주면 된다.
     
    notion image
     
    BlogApplication 을 실행하고 콘솔창을 본다.
    스프링 부트는 톰캣이 내장되어 있다.
     
    notion image
     
    레거시에거는 톰캣이 필요한데, 스프링부트는 내장되어있기 때문에 필요 없다.
    브라우저에서 확인해보자.
     
    notion image
     
    404 에러가 떴다는 것은 서버는 돌고 있다는 의미^^
    Share article
    Contents
    1. 프로젝트 세팅

    eunmouse

    RSS·Powered by Inblog