Spring boot + gradle 환경 구축하기

이리·2022년 1월 19일
0

  • 빨간색 사항 확인

  • 파란색(프로젝트명)은 하나만 수정해도 같이 간다.


  • spring initializr의 dependancies

  • edit configurations의 두 항목 다 update classes and resources

  • EOF

  • 코딩 컨벤션 (네이버 기준)
  1. 톱니 - import scheme - intellij IDEA code style xml - 해당 파일 선택

  2. ctrl + alt + L 습관화 !!



dependancies{

    ...
    
    //test에서도 lombok을 사용하고 싶을 때
    testCompileOnly 'org.projectlombok:lombok'
    testAnnotationProcessor 'org.projectlombok:lombok'
    
    // https://mvnrepository.com/artifact/mysql/mysql-connector-java
    // mysql 커넥터
    implementation group: 'mysql', name: 'mysql-connector-java', version: '8.0.27'
    
    //타임리프에서 dateFormat을 사용하기 위함
    implementation group: 'org.thymeleaf.extras', name: 'thymeleaf-extras-java8time'

    ...
}
  • build.gradle의 dependancies

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/****
spring.datasource.username=****
spring.datasource.password=****

spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.show-sql=true

spring.thymeleaf.cache=false
  • resources의 application.properties파일
  • hikariCP 기본적으로 사용
  • 책은 둘째 공주님 mariaDB를 사용하지만, 설치문제로 mysql로 따라가기로 하였다.
profile
어제보다 나은 사람이 되자

0개의 댓글