Skip to content

Commit

Permalink
refactor: gradle 환경변수로 h2 의존성 분기
Browse files Browse the repository at this point in the history
  • Loading branch information
nayonsoso committed Jan 15, 2025
1 parent 2ad96f9 commit 8eee61d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ repositories {
mavenCentral()
}

def activeProfile = project.findProperty("profile") ?: 'local'

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
Expand Down Expand Up @@ -57,7 +55,8 @@ dependencies {
testImplementation 'io.rest-assured:rest-assured'

// H2
if (activeProfile == 'local') {
def h2Environment = System.getenv('H2_ENVIRONMENT')
if (h2Environment == 'local') {
implementation 'com.h2database:h2'
} else {
testImplementation 'com.h2database:h2'
Expand Down

0 comments on commit 8eee61d

Please sign in to comment.