on
[스프링 부트] application.properties 세팅 참고
[스프링 부트] application.properties 세팅 참고
application.properties 를 세팅할 수 있는 방법중 하나.
이렇게 properties 파일을 여러개 둔다.
여기선 로컬에서 실행시 application-local.properties를 사용하고
서버에서 실행시 application-prod.properties를 사용한다.
그리고 둘중 어느것을 사용할지 정해주는게 application.properties이다.
> application.properties
로컬일때,
server.port=8080 spring.profiles.active=local
서버일때,
server.port=8080 spring.profiles.active=prod
> application-local.properties
spring.datasource.url=jdbc:tibero:thin:@220.90.208.123:8629:tibero spring.datasource.driver-class-name=com.tmax.tibero.jdbc.TbDriver spring.datasource.username=cms spring.datasource.password=cms mybatis.type-aliases-package=wapl.ai.driveapi mybatis.configuration.jdbc-type-for-null=varchar mybatis.mapper-locations=/mapper/**/*.xml mybatis.configuration.map-underscore-to-camel-case=true spring.jpa.hibernate.ddl-auto=none spring.jpa.open-in-view=false spring.jpa.properties.hibernate.show_sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.Oracle10gDialect spring.jpa.properties.hibernate.format_sql=true spring.jpa.properties.hibernate.use_sql_comments=true spring.servlet.multipart.enabled=true spring.servlet.multipart.max-file-size=6144MB spring.servlet.multipart.max-request-size=6144MB spring.servlet.multipart.location=C:\\temp\\spring_uploaded_files logging.level.com.spring.ibatis.UserMapper=DEBUG
> application-prod.properties
spring.datasource.driver-class-name=com.tmax.tibero.jdbc.TbDriver spring.datasource.jndi-name=cms spring.jta-enabled=false spring.jpa.hibernate.ddl-auto=none spring.jpa.properties.hibernate.show_sql=true spring.jpa.properties.hibernate.format_sql=true spring.jpa.properties.hibernate.use_sql_comments=true logging.level.org.hibernate.type.descriptor.sql=trace spring.jpa.database-platform=org.hibernate.dialect.Oracle10gDialect mybatis.type-aliases-package=wapl.ai.driveapi mybatis.configuration.jdbc-type-for-null=varchar mybatis.mapper-locations=/mapper/**/*.xml mybatis.configuration.map-underscore-to-camel-case=true spring.jpa.open-in-view=false spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.Oracle10gDialect spring.servlet.multipart.enabled=true spring.servlet.multipart.max-file-size=6144MB spring.servlet.multipart.max-request-size=6144MB spring.servlet.multipart.location=C:\\temp\\spring_uploaded_files logging.level.com.spring.ibatis.UserMapper=DEBUG
from http://gimmesome.tistory.com/205 by ccl(A) rewrite - 2021-12-22 14:27:34