Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zhangjian1949
apollo
提交
61ca5c83
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,发现更多精彩内容 >>
提交
61ca5c83
编写于
3月 25, 2016
作者:
Y
Yiming Liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update checkstyle conf
上级
8d374626
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
59 addition
and
55 deletion
+59
-55
.travis.yml
.travis.yml
+1
-1
apollo-client/src/main/java/com/ctrip/apollo/client/env/ClientEnvironment.java
...n/java/com/ctrip/apollo/client/env/ClientEnvironment.java
+28
-20
apollo-configservice/src/main/java/com/ctrip/apollo/ServerApplication.java
...ice/src/main/java/com/ctrip/apollo/ServerApplication.java
+0
-2
apollo-core/src/main/java/com/ctrip/apollo/Apollo.java
apollo-core/src/main/java/com/ctrip/apollo/Apollo.java
+1
-1
apollo-core/src/main/java/com/ctrip/apollo/core/MetaDomainConsts.java
...src/main/java/com/ctrip/apollo/core/MetaDomainConsts.java
+2
-2
pom.xml
pom.xml
+27
-29
未找到文件。
.travis.yml
浏览文件 @
61ca5c83
...
...
@@ -7,7 +7,7 @@ before_install:
after_success
:
-
mvn clean cobertura:cobertura coveralls:report
-
mvn clean site
-X
-
mvn clean site
-
codecov
branches
:
...
...
apollo-client/src/main/java/com/ctrip/apollo/client/env/ClientEnvironment.java
浏览文件 @
61ca5c83
...
...
@@ -41,11 +41,7 @@ public class ClientEnvironment {
if
(
env
.
get
()
==
null
)
{
Env
resultEnv
=
Apollo
.
getEnv
();
Properties
apolloProperties
=
null
;
try
{
apolloProperties
=
readConfigFile
(
DEFAULT_FILE
,
null
);
}
catch
(
IOException
e
)
{
throw
new
IllegalArgumentException
(
"Could not read Apollo properties"
);
}
apolloProperties
=
readConfigFile
(
DEFAULT_FILE
,
null
);
if
(
apolloProperties
!=
null
)
{
String
strEnv
=
apolloProperties
.
getProperty
(
Constants
.
ENV
);
if
(!
StringUtils
.
isBlank
(
strEnv
))
{
...
...
@@ -67,26 +63,38 @@ public class ClientEnvironment {
}
@SuppressWarnings
(
"unchecked"
)
private
Properties
readConfigFile
(
String
configPath
,
Properties
defaults
)
throws
IOException
{
private
Properties
readConfigFile
(
String
configPath
,
Properties
defaults
)
{
InputStream
in
=
this
.
getClass
().
getResourceAsStream
(
configPath
);
logger
.
info
(
"Reading config from resource {}"
,
configPath
);
if
(
in
==
null
)
{
// load outside resource under current user path
Path
path
=
new
File
(
System
.
getProperty
(
"user.dir"
)
+
configPath
).
toPath
();
if
(
Files
.
isReadable
(
path
))
{
in
=
new
FileInputStream
(
path
.
toFile
());
logger
.
info
(
"Reading config from file {} "
,
path
);
}
}
Properties
props
=
new
Properties
();
if
(
defaults
!=
null
)
{
props
.
putAll
(
defaults
);
}
try
{
if
(
in
==
null
)
{
// load outside resource under current user path
Path
path
=
new
File
(
System
.
getProperty
(
"user.dir"
)
+
configPath
).
toPath
();
if
(
Files
.
isReadable
(
path
))
{
in
=
new
FileInputStream
(
path
.
toFile
());
logger
.
info
(
"Reading config from file {} "
,
path
);
}
}
if
(
defaults
!=
null
)
{
props
.
putAll
(
defaults
);
}
if
(
in
!=
null
)
{
props
.
load
(
in
);
if
(
in
!=
null
)
{
props
.
load
(
in
);
in
.
close
();
}
}
catch
(
Exception
e
)
{
logger
.
warn
(
"Reading config failed: {}"
,
e
.
getMessage
());
}
finally
{
if
(
in
!=
null
)
{
try
{
in
.
close
();
}
catch
(
IOException
e
)
{
logger
.
warn
(
"Close config failed: {}"
,
e
.
getMessage
());
}
}
}
StringBuilder
sb
=
new
StringBuilder
();
for
(
Enumeration
<
String
>
e
=
(
Enumeration
<
String
>)
props
.
propertyNames
();
e
.
hasMoreElements
();)
{
...
...
apollo-configservice/src/main/java/com/ctrip/apollo/ServerApplication.java
浏览文件 @
61ca5c83
...
...
@@ -2,7 +2,6 @@ package com.ctrip.apollo;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
import
org.springframework.cloud.netflix.eureka.server.EnableEurekaServer
;
/**
...
...
@@ -12,7 +11,6 @@ import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
*/
@SpringBootApplication
@EnableEurekaServer
@EnableEurekaClient
public
class
ServerApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
apollo-core/src/main/java/com/ctrip/apollo/Apollo.java
浏览文件 @
61ca5c83
...
...
@@ -7,7 +7,7 @@ public class Apollo {
private
static
Env
m_env
;
public
enum
Env
{
LOCAL
,
DEV
,
FWS
,
FAT
,
UAT
,
LPT
,
PRO
D
,
TOOLS
LOCAL
,
DEV
,
FWS
,
FAT
,
UAT
,
LPT
,
PRO
,
TOOLS
}
public
static
void
initialize
(
Env
env
)
{
...
...
apollo-core/src/main/java/com/ctrip/apollo/core/MetaDomainConsts.java
浏览文件 @
61ca5c83
...
...
@@ -29,7 +29,7 @@ public class MetaDomainConsts {
public
static
final
String
TOOLS
=
"http://ws.meta.apollo.fx.tools.ctripcorp.com"
+
":"
+
DEFAULT_PORT
;
public
static
final
String
PR
D
=
"http://ws.meta.apollo.fx.ctripcorp.com"
+
":"
+
DEFAULT_PORT
;
public
static
final
String
PR
O
=
"http://ws.meta.apollo.fx.ctripcorp.com"
+
":"
+
DEFAULT_PORT
;
private
static
Map
<
Env
,
String
>
domains
=
new
HashMap
<>();
...
...
@@ -41,7 +41,7 @@ public class MetaDomainConsts {
domains
.
put
(
Env
.
UAT
,
UAT
);
domains
.
put
(
Env
.
LPT
,
LPT
);
domains
.
put
(
Env
.
TOOLS
,
TOOLS
);
domains
.
put
(
Env
.
PRO
D
,
PRD
);
domains
.
put
(
Env
.
PRO
,
PRO
);
}
public
static
String
getDomain
(
Env
env
)
{
...
...
pom.xml
浏览文件 @
61ca5c83
...
...
@@ -104,11 +104,11 @@
<artifactId>
mysql-connector-java
</artifactId>
<version>
5.1.38
</version>
</dependency>
<dependency>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
<version>
19.0
</version>
</dependency>
<dependency>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
<version>
19.0
</version>
</dependency>
<!--for test -->
<dependency>
<groupId>
com.h2database
</groupId>
...
...
@@ -161,25 +161,31 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-war-plugin
</artifactId>
<version>
2.3
</version>
<configuration>
<failOnMissingWebXml>
false
</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-war-plugin
</artifactId>
<version>
2.3
</version>
<configuration>
<failOnMissingWebXml>
false
</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-checkstyle-plugin
</artifactId>
<version>
2.17
</version>
<dependencies>
<dependency>
<groupId>
com.puppycrawl.tools
</groupId>
<artifactId>
checkstyle
</artifactId>
<version>
6.16.1
</version>
</dependency>
</dependencies>
<dependency>
<groupId>
com.puppycrawl.tools
</groupId>
<artifactId>
checkstyle
</artifactId>
<version>
6.16.1
</version>
</dependency>
</dependencies>
<configuration>
<configLocation>
google_checks.xml
</configLocation>
<failOnViolation>
false
</failOnViolation>
<linkXRef>
false
</linkXRef>
<consoleOutput>
true
</consoleOutput>
</configuration>
</plugin>
</plugins>
</pluginManagement>
...
...
@@ -203,10 +209,6 @@
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-checkstyle-plugin
</artifactId>
<configuration>
<configLocation>
google_checks.xml
</configLocation>
<failOnViolation>
false
</failOnViolation>
</configuration>
</plugin>
</plugins>
</build>
...
...
@@ -240,7 +242,7 @@
</build>
</profile>
</profiles>
<repositories>
<repository>
<id>
spring-milestones
</id>
...
...
@@ -256,10 +258,6 @@
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-checkstyle-plugin
</artifactId>
<configuration>
<configLocation>
google_checks.xml
</configLocation>
<failOnViolation>
false
</failOnViolation>
</configuration>
</plugin>
</plugins>
</reporting>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录