Skip to content

Commit

Permalink
Merge pull request #5 from everymeals/chore/project-setting
Browse files Browse the repository at this point in the history
[Chore/project setting] #1 dependency 추가 및 yml파일 분리
  • Loading branch information
Qbeom0925 authored Jul 11, 2023
2 parents c3a6f49 + baea091 commit 35d4d9a
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ out/

### VS Code ###
.vscode/

*.log
40 changes: 40 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,46 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

//logging
implementation 'org.springframework.boot:spring-boot-starter-logging'

// spring web
implementation 'org.springframework.boot:spring-boot-starter-web'

//lombok
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok'

//Validation
implementation 'org.springframework.boot:spring-boot-starter-validation'

//SWAGGER
implementation 'org.springdoc:springdoc-openapi-webmvc-core:1.7.0'
implementation 'org.springframework.boot:spring-boot-starter-actuator'

//Spring Data JPA
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.hibernate.orm:hibernate-core:6.2.5.Final'

//QueryDSL
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"

//테스트용 H2
implementation 'com.h2database:h2'

//prometheus
implementation 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'

//AOP
implementation 'org.springframework.boot:spring-boot-starter-aop'

//MAYBE Nullable 빌드 에러 경고 해결
implementation 'com.google.code.findbugs:jsr305:3.0.2'
}

tasks.named('test') {
Expand Down
Empty file.
41 changes: 41 additions & 0 deletions src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#spring:
# application:
# name: EveryMeal-server-test
# config:
# activate:
# on-profile: test
# datasource:
# driver-class-name: org.h2.Driver
# url: jdbc:h2:mem:~/test # h2 support in-memory-db
# username: sa
# password:
#
# h2:
# console:
# enabled: true
# path: /h2-console
# sql:
# init:
# mode: always
# schema-locations: classpath*:db/schema.sql
# data-locations: classpath*:db/data.sql
# jpa:
# properties:
# hibernate:
# dialect: org.hibernate.dialect.H2Dialect
# show_sql: false
# format_sql: false
# hbm2ddl:
# auto: none
# showSql: false
# database-platform: org.hibernate.dialect.H2Dialect
#
#swagger:
# enabled: true
#
#log:
# config:
# path: ./logs
# filename: app-dev
# maxHistory: 1 # 1일
# totalSizeCap: 10MB # 로그 파일 사이즈
66 changes: 66 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1 +1,67 @@
server:
port: 80
error:
path: /error

spring:
application:
name: EveryMeal-server-main
# datasource:
# driver-class-name: com.mysql.cj.jdbc.Driver
servlet:
multipart:
enabled: true
max-file-size: 100MB
max-request-size: 100MB
# jpa:
# properties:
# hibernate:
# dialect: org.hibernate.dialect.MySQLDialect
# show_sql: false
# format_sql: false
# use_sql_comments: true
# id:
# new_generator_mappings: true
# naming: #네이밍 카멜케이스 컬럼명 적용
# implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
# physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

management:
endpoint:
metrics:
enabled: true
prometheus:
enabled: true

endpoints:
web:
exposure:
include: health, info, metrics, prometheus

metrics:
tags:
application: ${spring.application.name}

springdoc:
api-docs:
groups-order: DESC
enabled: true
swagger-ui:
path: /swagger-ui.html
groups-order: DESC
path: /api-docs

---
# Local
spring:
config:
activate:
on-profile: local
import: application-local.yml
---
# PROD
spring:
config:
activate:
on-profile: prod
import: application-prod.yml

0 comments on commit 35d4d9a

Please sign in to comment.