Я пытаюсь реализовать функцию соответствия шаблону конфигурации весеннего облака на основе различных профилей для приложения. На основе документации в http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_environment_repository можно сопоставить репозитории на основе профилей. Ниже мой конфигурации сервера application.ymlсопоставление шаблонов весеннего облака для профиля
server:
port: 8888
spring:
cloud:
config:
server:
git:
uri: ssh://[email protected]/sample/cloud-config-properties.git
repos:
development:
pattern:
-*/development
-*/staging
uri: ssh://[email protected]/development.git
test:
pattern:
-*/test
-*/perf
uri: ${HOME}/Documents/cloud-config-sample-test
У меня есть клиентское приложение конфигурации «пользователь» и есть user.properties, user-development.properties, user-test.properties
На основе документации - независимо от имени приложения, если шаблон соответствует */development i, e localhost: 8888/user/development или localhost: 8888/demo/development, мой конфигурационный сервер должен соответствовать шаблону профиля и извлекать соответствующие свойства. Ex: http://localhost:8888/demo/development я должен получить demo-development.properties от SSH: //[email protected]/development.git
Но в моем приложении, Ури по умолчанию используется для всех профилей, то есть мой файл свойство демку .properties возвращается с uri: ssh: //[email protected]/sample/cloud-config-properties.git
Любые указатели на это?
EDIT: pom.xml
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>Brixton.M5</version>
<relativePath />
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-monitor</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-snapshots-continuous</id>
<name>Spring Snapshots Continuous</name>
<url>http://repo.spring.io/libs-snapshot-continuous-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/libs-release-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Какая версия вы используете? – spencergibb
Brixton.M5 pom.xml: \t org.springframework.cloud \t весна-облако стартер-родитель \t Brixton.M5 \t \t –