diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index fdc392f..f5a0c5d 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -16,5 +16,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index e27ee1d..e2d83dd 100644
--- a/build.gradle
+++ b/build.gradle
@@ -20,15 +20,14 @@ configurations {
}
repositories {
- mavenCentral() // 기존 Maven Central 저장소
- maven { url 'https://jitpack.io' } // JitPack 저장소 추가
+ mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'mysql:mysql-connector-java:8.0.33'
- implementation 'com.github.cdimascio:dotenv-spring-boot:2.2.0'
+ implementation 'io.github.cdimascio:dotenv-java:2.2.0'
// SpringDoc OpenAPI 의존성
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'
diff --git a/src/main/java/goormthonUniv/floating/FloatingApplication.java b/src/main/java/goormthonUniv/floating/FloatingApplication.java
index 3eb2888..ae9ca75 100644
--- a/src/main/java/goormthonUniv/floating/FloatingApplication.java
+++ b/src/main/java/goormthonUniv/floating/FloatingApplication.java
@@ -1,5 +1,6 @@
package goormthonUniv.floating;
+import io.github.cdimascio.dotenv.Dotenv;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -7,7 +8,25 @@
public class FloatingApplication {
public static void main(String[] args) {
+ // .env 파일 로드
+ Dotenv dotenv = Dotenv.load();
+
+ // 환경 변수 읽기
+ String dbUrl = dotenv.get("DB_URL");
+ String dbUsername = dotenv.get("DB_USERNAME");
+ String dbPassword = dotenv.get("DB_PASSWORD");
+ String oauthClientId = dotenv.get("OAUTH_CLIENT_ID");
+ String oauthClientSecret = dotenv.get("OAUTH_CLIENT_SECRET");
+
+ // 환경 변수를 시스템에 설정 (필요한 경우)
+ System.setProperty("DB_URL", dbUrl);
+ System.setProperty("DB_USERNAME", dbUsername);
+ System.setProperty("DB_PASSWORD", dbPassword);
+ System.setProperty("OAUTH_CLIENT_ID", oauthClientId);
+ System.setProperty("OAUTH_CLIENT_SECRET", oauthClientSecret);
+
SpringApplication.run(FloatingApplication.class, args);
+
}
}