true
maven2-release
http://uk.maven.org/maven2/
SsoConfigApplication.java
配置管理服务服务支持
/*
- 版权所有.©2008-2017. 卡尔科技工作室
*/
package com.carl.auth.ssoconfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
@SpringBootApplication
@EnableConfigServer
public class SsoConfigApplication {
public static void main(String[] args) {
SpringApplication.run(SsoConfigApplication.class, args);
}
}
application.properties/yml
把application.properties修改成application.yml,因为yml文件更直观
该配置文件为配置中心的项目设置
#指定日志输出文件
logging:
file: “logs/sso-config.log”
info:
name : “配置中心”
server:
#服务端口
port: 8888
#访问路径
context-path: /config
spring:
profiles:
#本地配置文件
active:
#配置文件本地化
- native
application:
#指定应用名称
name: sso-config
启动
mvn spring-boot:run
若看到如下结果,恭喜你,配置成功
2017-09-09 15:54:44.776 INFO 10696 — [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean ‘refreshEndpoint’: registering with J
MX server as MBean [org.springframework.cloud.endpoint:name=refreshEndpoint,type=RefreshEndpoint]
2017-09-09 15:54:45.287 INFO 10696 — [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0
2017-09-09 15:54:45.727 INFO 10696 — [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8888 (http)
2017-09-09 15:54:45.743 INFO 10696 — [ main] c.c.auth.ssoconfig.SsoConfigApplication : Started SsoConfigApplication in 17.302 seconds (JVM runnin
g for 28.779)
可以尝试访问