Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Springboot web, jpa, lombok 의존성 추가 #7

Merged
merged 4 commits into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ out/

**/resources/.env
**/resources/.env.*
!**/resources/.env.example
17 changes: 17 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ repositories {

dependencies {
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.postgresql:postgresql:42.7.3")
implementation("me.paulschwarz:spring-dotenv:4.0.0")

// Lombok
annotationProcessor("org.projectlombok:lombok:1.18.34")
testCompileOnly("org.projectlombok:lombok:1.18.34")
testAnnotationProcessor("org.projectlombok:lombok:1.18.34")

// testcontainers
testImplementation("org.testcontainers:testcontainers:1.20.0")
testImplementation("org.testcontainers:junit-jupiter:1.20.0")
testImplementation("org.testcontainers:jdbc:1.20.0")
testImplementation("org.testcontainers:postgresql:1.20.0")

testImplementation("org.springframework.boot:spring-boot-starter-test")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DATABASE_HOST=
DATABASE_PORT=
DATABASE_NAME=
DATABASE_USER=
DATABASE_PASSWORD=
1 change: 0 additions & 1 deletion src/main/resources/application.properties

This file was deleted.

25 changes: 25 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
spring.application.name: run-us

spring:
jpa:
hibernate:
ddl-auto: none
show-sql: true
open-in-view: false

datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}
username: ${DATABASE_USER}
password: ${DATABASE_PASSWORD}

---
spring.config.activate.on-profile: local

spring:
jpa:
hibernate:
ddl-auto: update

---
spring.config.activate.on-profile: prod
11 changes: 11 additions & 0 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
spring:
jpa:
hibernate:
ddl-auto: create
show-sql: true
open-in-view: false
defer-datasource-initialization: true

datasource:
driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver
url: jdbc:tc:postgresql:16.3://test