멀티모듈 properties 분리 적용

달래·2024년 3월 5일
0

개인프로젝트

목록 보기
6/6

아니 정말 뻘짓을 했다...
main메소드가있는 Application 파일의 위치가 application 모듈에 있는데, application.properties 파일을 api 모듈에 위치해놔서 아무리 spring.profiles.include로 properties파일을 불러오려고해도 불러와지지가 않았던것..ㅠㅠ 당연함 application 모듈에 application.properties가 없음..하하..^^

환경 분리까진 하지않았음..!

api 모듈
ㄴ application-api-diary.properties
application 모듈
ㄴ application.properties
core-mysql 모듈
ㄴ application-core-mysql.properties
...

application.properties

spring.profiles.include=api-diary,auth,auth-oauth2,aws,core-mysql,core-redis

application-core-mysql.properties

## mysql db
spring.datasource.url=...
useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&autoReconnect=true&allowPublicKeyRetrieval=true
spring.datasource.username=...
spring.datasource.password=...
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

## jpa
spring.jpa.database=mysql
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.format_sql=true

application-api-diary.properties

# multipart file size
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB

# Swagger
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
profile
아좌잣~!

0개의 댓글