2017-05-13 4 views

답변

2

구성 서버를보고있는 자식 또는 파일 시스템에서 등록 정보 파일의 이름을 변경하십시오.

a.properties -> <your_application_name>.properties 
a.properties -> <your_application_name>-<profile-name>.properties 

예를 들어, 응용 프로그램 이름이 test하고 두 가지 속성이 함께 사용됩니다 다음은, dev 프로필에 응용 프로그램을 실행하는 경우.

test.properties 
test-dev.properties 

또한 당신은 아래와 같은 이상의 속성 파일을 검색하도록 설정 클라이언트의 bootstrap.properties에 추가 프로파일을 지정할 수 있습니다. 예 :

spring: 
    profiles: dev 
    cloud: 
    config: 
     uri: http://yourconfigserver.com:8888 
     profile: dev,dev-db,dev-mq 

위와 같이 지정하면 모든 파일이 함께 사용됩니다.

test.properties 
test-dev.properties 
test-dev-db.prpoerties 
test-dev-mq.properties 
+0

감사합니다. 그것은 나를 더 깊게 이해할 수있게 해준다. –

+3

'spring.application.name = a, b'도 할 수있다. – spencergibb