Joshua게시판(SSR)-2-yml 세팅

jaegeunsong97·2023년 8월 13일
0

SSR 기반 JoshuaBlog

목록 보기
2/23

깃허브

spring:
  profiles:
    active:
    - dev
  • application-dev.yml
server:
  servlet:
    encoding:
      charset: utf-8
      force: true
  port: 8080

spring:
  mvc:
    view:
      prefix: /WEB-INF/views/
      suffix: .jsp
  datasource:
    url: jdbc:h2:mem:test;MODE=MySQL
    driver-class-name: org.h2.Driver
    username: sa
    password:
  h2:
    console:
      enabled: true
  jpa:
    hibernate:
      ddl-auto: create
    show-sql: true
    properties:
      hibernate:
        format_sql: true
      default_batch_fetch_size: 100 
    open-in-view: false # 세션값이 VIEW까지 가지 못함
  output:
    ansi:
      enabled: always 
  servlet:
    multipart:
      max-file-size: 10MB
      enabled: true
logging:
  level:
    '[pastry.coffeecoding.joshuablog]': DEBUG
    '[org.hibernate.type]': TRACE

file:
  path: ./upload/
  • application-prod.yml
server:
  servlet:
    encoding:
      charset: utf-8
      force: true
  port: 80

spring:
  mvc:
    view:
      prefix: /WEB-INF/views/
      suffix: .jsp
  datasource:
    url: jdbc:mariadb://${rds.hostname}:${rds.port}/${rds.db.name}?allowPublicKeyRetrieval=true&useSSL=false
    driver-class-name: org.mariadb.jdbc.Driver
    username: ${rds.username}
    password: ${rds.password}
  jpa:
    hibernate:
      ddl-auto: none
      default_batch_fetch_size: 100
    open-in-view: false
logging:
  level:
    '[coffee.pastry.joshuablog]': INFO

tdiwe : trace -> debug -> info -> warn -> error

trace 설정 : trace -> debug -> info -> warn -> error

info 설정 : info -> warn -> error

warn 설정 : warn -> error

배표힐 때는 INFO

  • application-test.yml
server:
  servlet:
    encoding:
      charset: utf-8
      force: true
  port: 8080

spring:
  mvc:
    view:
      prefix: /WEB-INF/views/
      suffix: .jsp
  datasource:
    url: jdbc:h2:mem:test;MODE=MySQL
    driver-class-name: org.h2.Driver
    username: sa
    password:
  h2:
    console:
      enabled: true
  jpa:
    hibernate:
      ddl-auto: create
    show-sql: true
    properties:
      hibernate:
        format_sql: true
      default_batch_fetch_size: 100
    open-in-view: false
  output:
    ansi:
      enabled: always
logging:
  level:
    '[coffee.pastry.joshuablog]': DEBUG
    '[org.hibernate.type]': TRACE

배포

jar 파일 생성

./gradle build 

prod 모드로 배포파일 실행

java -Dspring.profile.active=prod -jar application.jar

실행 후 확인

Run 클릭 따란~~

dev로 잘 작동하는 구만

profile
현재 블로그 : https://jasonsong97.tistory.com/

0개의 댓글