파일 :
application.properties봄 부팅 속성 내가 현재 3 개 곳의 파일이 외부화
[email protected]@
을
#DB properties:
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/mydb
db.username=user
db.password=pswd
#Data source management:
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.show_sql=true
hibernate.current_session_context_class=thread
이을 application-production.properties application-develoment.properties
#DB properties:
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/myproddb
db.username=admin
db.password=admin
#Data source management:
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.show_sql=false
hibernate.current_session_context_class=thread
내 의 pom.xml
<profiles>
<profile>
<id>development</id>
<properties>
<activatedProperties>development</activatedProperties>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>production</id>
<properties>
<activatedProperties>production</activatedProperties>
</properties>
</profile>
</profiles>
을에서 다음과 같이 내 받는다는 프로파일을 설정 한 내 DataSourceConfig의 : annotaion @PropertySource (값 = "클래스 경로 : application.properties")
개발 또는 프로덕션 프로필로 컴파일 할 때 모든 것이 잘 작동하지만 이제는 Tomcat 서버의/conf/localhost 디렉토리에 속성 파일을 외부화하려고합니다. 어떻게해야할까요?
.jar이 배치 된 곳에 application - *. properties 파일을 넣기 만하면됩니다. –