Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zhangjian1949
apollo
提交
4f653461
apollo
项目概览
zhangjian1949
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4f653461
编写于
5月 16, 2016
作者:
Y
Yiming Liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enable local start config/admin/portal
上级
43434383
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
155 addition
and
13 deletion
+155
-13
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/AdminServiceApplication.java
...om/ctrip/apollo/adminservice/AdminServiceApplication.java
+2
-0
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/IndexController.java
...ctrip/apollo/adminservice/controller/IndexController.java
+14
-0
apollo-adminservice/src/test/java/com/ctrip/apollo/AdminServiceTestConfiguration.java
.../java/com/ctrip/apollo/AdminServiceTestConfiguration.java
+1
-1
apollo-adminservice/src/test/java/com/ctrip/apollo/LocalAdminServiceApplication.java
...t/java/com/ctrip/apollo/LocalAdminServiceApplication.java
+2
-2
apollo-assembly/src/main/java/com/ctrip/apollo/assembly/ApolloApplication.java
...ain/java/com/ctrip/apollo/assembly/ApolloApplication.java
+0
-1
apollo-assembly/src/test/java/com/ctrip/apollo/assembly/LocalApolloApplication.java
...ava/com/ctrip/apollo/assembly/LocalApolloApplication.java
+62
-0
apollo-assembly/src/test/resources/application.properties
apollo-assembly/src/test/resources/application.properties
+6
-0
apollo-assembly/src/test/resources/application.yml
apollo-assembly/src/test/resources/application.yml
+3
-0
apollo-assembly/src/test/resources/logback-test.xml
apollo-assembly/src/test/resources/logback-test.xml
+15
-0
apollo-common/src/main/java/com/ctrip/apollo/common/controller/CharacterEncodingFilterConfiguration.java
...mmon/controller/CharacterEncodingFilterConfiguration.java
+25
-0
apollo-common/src/main/java/com/ctrip/apollo/common/controller/WebMvcConfig.java
...java/com/ctrip/apollo/common/controller/WebMvcConfig.java
+2
-2
apollo-common/src/main/resources/application.properties
apollo-common/src/main/resources/application.properties
+1
-0
apollo-configservice/src/main/java/com/ctrip/apollo/configservice/ConfigServiceApplication.java
.../ctrip/apollo/configservice/ConfigServiceApplication.java
+5
-2
apollo-configservice/src/main/java/com/ctrip/apollo/metaservice/ApolloMetaServiceConfig.java
...com/ctrip/apollo/metaservice/ApolloMetaServiceConfig.java
+12
-0
apollo-configservice/src/test/java/com/ctrip/apollo/ConfigServiceTestConfiguration.java
...java/com/ctrip/apollo/ConfigServiceTestConfiguration.java
+1
-1
apollo-configservice/src/test/java/com/ctrip/apollo/LocalConfigServiceApplication.java
.../java/com/ctrip/apollo/LocalConfigServiceApplication.java
+2
-2
apollo-portal/src/test/java/com/ctrip/apollo/LocalPortalApplication.java
...rc/test/java/com/ctrip/apollo/LocalPortalApplication.java
+2
-2
未找到文件。
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/AdminServiceApplication.java
浏览文件 @
4f653461
...
...
@@ -10,12 +10,14 @@ import org.springframework.context.annotation.ComponentScan;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.EnableAspectJAutoProxy
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
@EnableAspectJAutoProxy
@EnableEurekaClient
@Configuration
@PropertySource
(
value
=
{
"classpath:adminservice.properties"
})
@EnableAutoConfiguration
@EnableTransactionManagement
@ComponentScan
(
basePackageClasses
=
{
com
.
ctrip
.
apollo
.
common
.
ApolloCommonConfig
.
class
,
com
.
ctrip
.
apollo
.
biz
.
ApolloBizConfig
.
class
,
com
.
ctrip
.
apollo
.
adminservice
.
AdminServiceApplication
.
class
})
...
...
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/IndexController.java
0 → 100644
浏览文件 @
4f653461
package
com.ctrip.apollo.adminservice.controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
path
=
"/"
)
public
class
IndexController
{
@RequestMapping
(
path
=
""
)
public
String
index
()
{
return
"apollo-adminservice"
;
}
}
apollo-adminservice/src/test/java/com/ctrip/apollo/AdminServiceTestConfiguration.java
浏览文件 @
4f653461
...
...
@@ -12,7 +12,7 @@ import com.ctrip.apollo.adminservice.AdminServiceApplication;
@Configuration
@ComponentScan
(
excludeFilters
=
{
@Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
value
=
{
Sample
AdminServiceApplication
.
class
,
AdminServiceApplication
.
class
,
Local
AdminServiceApplication
.
class
,
AdminServiceApplication
.
class
,
HttpMessageConverterConfiguration
.
class
})})
@EnableAutoConfiguration
public
class
AdminServiceTestConfiguration
{
...
...
apollo-
configservice/src/test/java/com/ctrip/apollo/SampleConfig
ServiceApplication.java
→
apollo-
adminservice/src/test/java/com/ctrip/apollo/LocalAdmin
ServiceApplication.java
浏览文件 @
4f653461
...
...
@@ -6,8 +6,8 @@ import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public
class
SampleConfig
ServiceApplication
{
public
class
LocalAdmin
ServiceApplication
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
SampleConfig
ServiceApplication
.
class
).
run
(
args
);
new
SpringApplicationBuilder
(
LocalAdmin
ServiceApplication
.
class
).
run
(
args
);
}
}
apollo-assembly/src/main/java/com/ctrip/apollo/assembly/ApolloApplication.java
浏览文件 @
4f653461
...
...
@@ -3,7 +3,6 @@ package com.ctrip.apollo.assembly;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.boot.actuate.system.ApplicationPidFileWriter
;
import
org.springframework.boot.actuate.system.EmbeddedServerPortFileWriter
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
;
...
...
apollo-assembly/src/test/java/com/ctrip/apollo/assembly/LocalApolloApplication.java
0 → 100644
浏览文件 @
4f653461
package
com.ctrip.apollo.assembly
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.boot.actuate.system.ApplicationPidFileWriter
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.cloud.context.scope.refresh.RefreshScope
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
com.ctrip.apollo.adminservice.AdminServiceApplication
;
import
com.ctrip.apollo.configservice.ConfigServiceApplication
;
import
com.ctrip.apollo.portal.PortalApplication
;
@SpringBootApplication
(
exclude
=
{
DataSourceAutoConfiguration
.
class
,
HibernateJpaAutoConfiguration
.
class
})
public
class
LocalApolloApplication
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ApolloApplication
.
class
);
public
static
void
main
(
String
[]
args
)
throws
Exception
{
/**
* Common
*/
ConfigurableApplicationContext
commonContext
=
new
SpringApplicationBuilder
(
ApolloApplication
.
class
).
web
(
false
).
run
(
args
);
commonContext
.
addApplicationListener
(
new
ApplicationPidFileWriter
());
logger
.
info
(
commonContext
.
getId
()
+
" isActive: "
+
commonContext
.
isActive
());
/**
* ConfigService
*/
if
(
commonContext
.
getEnvironment
().
containsProperty
(
"configservice"
))
{
ConfigurableApplicationContext
configContext
=
new
SpringApplicationBuilder
(
ConfigServiceApplication
.
class
).
parent
(
commonContext
)
.
sources
(
RefreshScope
.
class
).
run
(
args
);
logger
.
info
(
configContext
.
getId
()
+
" isActive: "
+
configContext
.
isActive
());
}
/**
* AdminService
*/
if
(
commonContext
.
getEnvironment
().
containsProperty
(
"adminservice"
))
{
ConfigurableApplicationContext
adminContext
=
new
SpringApplicationBuilder
(
AdminServiceApplication
.
class
).
parent
(
commonContext
)
.
sources
(
RefreshScope
.
class
).
run
(
args
);
logger
.
info
(
adminContext
.
getId
()
+
" isActive: "
+
adminContext
.
isActive
());
}
/**
* Portal
*/
if
(
commonContext
.
getEnvironment
().
containsProperty
(
"portal"
))
{
ConfigurableApplicationContext
portalContext
=
new
SpringApplicationBuilder
(
PortalApplication
.
class
).
parent
(
commonContext
).
run
(
args
);
logger
.
info
(
portalContext
.
getId
()
+
" isActive: "
+
portalContext
.
isActive
());
}
}
}
apollo-assembly/src/test/resources/application.properties
0 → 100644
浏览文件 @
4f653461
spring.datasource.url
=
jdbc:h2:mem:~/apolloconfigdb;mode=mysql;DB_CLOSE_ON_EXIT=FALSE
spring.jpa.hibernate.naming_strategy
=
org.hibernate.cfg.EJB3NamingStrategy
spring.jpa.properties.hibernate.show_sql
=
true
spring.h2.console.enabled
=
true
spring.h2.console.settings.web-allow-others
=
true
apollo.portal.env
=
local
apollo-assembly/src/test/resources/application.yml
0 → 100644
浏览文件 @
4f653461
spring
:
profiles
:
active
:
local
apollo-assembly/src/test/resources/logback-test.xml
0 → 100644
浏览文件 @
4f653461
<?xml version="1.0" encoding="UTF-8"?>
<configuration
scan=
"true"
>
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<charset>
utf-8
</charset>
<Pattern>
[%p] %c - %m%n
</Pattern>
</encoder>
</appender>
<logger
name=
"org.springframework.test"
level=
"OFF"
/>
<root
level=
"INFO"
>
<appender-ref
ref=
"CONSOLE"
/>
</root>
</configuration>
\ No newline at end of file
apollo-common/src/main/java/com/ctrip/apollo/common/controller/CharacterEncodingFilterConfiguration.java
0 → 100644
浏览文件 @
4f653461
package
com.ctrip.apollo.common.controller
;
import
javax.servlet.DispatcherType
;
import
org.springframework.boot.context.embedded.FilterRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.filter.CharacterEncodingFilter
;
@Configuration
public
class
CharacterEncodingFilterConfiguration
{
@Bean
public
FilterRegistrationBean
encodingFilter
()
{
FilterRegistrationBean
bean
=
new
FilterRegistrationBean
();
bean
.
setFilter
(
new
CharacterEncodingFilter
());
bean
.
addInitParameter
(
"encoding"
,
"UTF-8"
);
//FIXME: https://github.com/Netflix/eureka/issues/702
// bean.addInitParameter("forceEncoding", "true");
bean
.
setName
(
"encodingFilter"
);
bean
.
addUrlPatterns
(
"/*"
);
bean
.
setDispatcherTypes
(
DispatcherType
.
REQUEST
,
DispatcherType
.
FORWARD
);
return
bean
;
}
}
apollo-common/src/main/java/com/ctrip/apollo/common/controller/WebMvcConfig.java
浏览文件 @
4f653461
package
com.ctrip.apollo.common.controller
;
import
java.util.List
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.web.PageableHandlerMethodArgumentResolver
;
...
...
@@ -8,8 +10,6 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import
org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
import
java.util.List
;
@Configuration
public
class
WebMvcConfig
extends
WebMvcConfigurerAdapter
{
...
...
apollo-common/src/main/resources/application.properties
0 → 100644
浏览文件 @
4f653461
spring.http.converters.preferred-json-mapper
=
gson
\ No newline at end of file
apollo-configservice/src/main/java/com/ctrip/apollo/configservice/ConfigServiceApplication.java
浏览文件 @
4f653461
...
...
@@ -10,6 +10,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
/**
* Spring boot application entry point
...
...
@@ -19,12 +20,14 @@ import org.springframework.context.annotation.PropertySource;
@EnableEurekaServer
@EnableAspectJAutoProxy
@EnableAutoConfiguration
//
(exclude = EurekaClientConfigBean.class)
@EnableAutoConfiguration
//
(exclude = EurekaClientConfigBean.class)
@Configuration
@EnableTransactionManagement
@PropertySource
(
value
=
{
"classpath:configservice.properties"
})
@ComponentScan
(
basePackageClasses
=
{
com
.
ctrip
.
apollo
.
common
.
ApolloCommonConfig
.
class
,
com
.
ctrip
.
apollo
.
biz
.
ApolloBizConfig
.
class
,
com
.
ctrip
.
apollo
.
configservice
.
ConfigServiceApplication
.
class
})
com
.
ctrip
.
apollo
.
configservice
.
ConfigServiceApplication
.
class
,
com
.
ctrip
.
apollo
.
metaservice
.
ApolloMetaServiceConfig
.
class
})
public
class
ConfigServiceApplication
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
...
...
apollo-configservice/src/main/java/com/ctrip/apollo/metaservice/ApolloMetaServiceConfig.java
0 → 100644
浏览文件 @
4f653461
package
com.ctrip.apollo.metaservice
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
@EnableAutoConfiguration
@Configuration
@ComponentScan
(
basePackageClasses
=
com
.
ctrip
.
apollo
.
metaservice
.
ApolloMetaServiceConfig
.
class
)
public
class
ApolloMetaServiceConfig
{
}
apollo-configservice/src/test/java/com/ctrip/apollo/ConfigServiceTestConfiguration.java
浏览文件 @
4f653461
...
...
@@ -11,7 +11,7 @@ import org.springframework.context.annotation.FilterType;
@Configuration
@ComponentScan
(
excludeFilters
=
{
@Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
value
=
{
Sample
ConfigServiceApplication
.
class
,
ConfigServiceApplication
.
class
,
WebSecurityConfig
.
class
})})
Local
ConfigServiceApplication
.
class
,
ConfigServiceApplication
.
class
,
WebSecurityConfig
.
class
})})
@EnableAutoConfiguration
public
class
ConfigServiceTestConfiguration
{
...
...
apollo-
adminservice/src/test/java/com/ctrip/apollo/SampleAdmin
ServiceApplication.java
→
apollo-
configservice/src/test/java/com/ctrip/apollo/LocalConfig
ServiceApplication.java
浏览文件 @
4f653461
...
...
@@ -6,8 +6,8 @@ import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public
class
SampleAdmin
ServiceApplication
{
public
class
LocalConfig
ServiceApplication
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
SampleAdmin
ServiceApplication
.
class
).
run
(
args
);
new
SpringApplicationBuilder
(
LocalConfig
ServiceApplication
.
class
).
run
(
args
);
}
}
apollo-portal/src/test/java/com/ctrip/apollo/
Sample
PortalApplication.java
→
apollo-portal/src/test/java/com/ctrip/apollo/
Local
PortalApplication.java
浏览文件 @
4f653461
...
...
@@ -4,8 +4,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
@SpringBootApplication
public
class
Sample
PortalApplication
{
public
class
Local
PortalApplication
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
Sample
PortalApplication
.
class
).
run
(
args
);
new
SpringApplicationBuilder
(
Local
PortalApplication
.
class
).
run
(
args
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录