Break @ConfigurationProperties out to type level
This commit is contained in:
@@ -194,6 +194,7 @@ public class ConfigClientProperties {
|
||||
public void setServiceId(String serviceId) {
|
||||
this.serviceId = serviceId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ConfigClientProperties override(
|
||||
|
||||
@@ -17,7 +17,6 @@ package org.springframework.cloud.config.server;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -37,8 +36,7 @@ public class ConfigServerConfiguration {
|
||||
@Profile("native")
|
||||
protected static class NativeRepositoryConfiguration {
|
||||
@Bean
|
||||
@ConfigurationProperties("spring.cloud.config.server.native")
|
||||
public SpringApplicationEnvironmentRepository repository() {
|
||||
public SpringApplicationEnvironmentRepository EnvironmentRepository() {
|
||||
return new SpringApplicationEnvironmentRepository();
|
||||
}
|
||||
}
|
||||
@@ -50,9 +48,9 @@ public class ConfigServerConfiguration {
|
||||
private ConfigurableEnvironment environment;
|
||||
|
||||
@Bean
|
||||
@ConfigurationProperties("spring.cloud.config.server.git")
|
||||
public JGitEnvironmentRepository repository() {
|
||||
public JGitEnvironmentRepository EnvironmentRepository() {
|
||||
return new JGitEnvironmentRepository(environment);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,6 +42,7 @@ import org.eclipse.jgit.transport.JschConfigSessionFactory;
|
||||
import org.eclipse.jgit.transport.SshSessionFactory;
|
||||
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
|
||||
import org.eclipse.jgit.transport.OpenSshConfig.Host;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.cloud.config.Environment;
|
||||
import org.springframework.cloud.config.PropertySource;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
@@ -55,6 +56,7 @@ import com.jcraft.jsch.Session;
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
@ConfigurationProperties("spring.cloud.config.server.git")
|
||||
public class JGitEnvironmentRepository implements EnvironmentRepository {
|
||||
|
||||
public static final String DEFAULT_URI = "https://github.com/spring-cloud-samples/config-repo";
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.List;
|
||||
|
||||
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.core.env.MapPropertySource;
|
||||
@@ -38,6 +39,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
@ConfigurationProperties("spring.cloud.config.server.native")
|
||||
public class SpringApplicationEnvironmentRepository implements EnvironmentRepository {
|
||||
|
||||
private String[] locations;
|
||||
|
||||
Reference in New Issue
Block a user