Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
0ee03b80
Commit
0ee03b80
authored
Mar 25, 2016
by
Jason Song
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #37 from yiming187/style_update
Update checkstyle conf
parents
8d374626
61ca5c83
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
55 deletions
+59
-55
.travis.yml
.travis.yml
+1
-1
ClientEnvironment.java
...n/java/com/ctrip/apollo/client/env/ClientEnvironment.java
+28
-20
ServerApplication.java
...ice/src/main/java/com/ctrip/apollo/ServerApplication.java
+0
-2
Apollo.java
apollo-core/src/main/java/com/ctrip/apollo/Apollo.java
+1
-1
MetaDomainConsts.java
...src/main/java/com/ctrip/apollo/core/MetaDomainConsts.java
+2
-2
pom.xml
pom.xml
+27
-29
No files found.
.travis.yml
View file @
0ee03b80
...
...
@@ -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
View file @
0ee03b80
...
...
@@ -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
View file @
0ee03b80
...
...
@@ -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
View file @
0ee03b80
...
...
@@ -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
View file @
0ee03b80
...
...
@@ -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
View file @
0ee03b80
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment